Buggy code:
public class Chessboard2D extends ChessboardView { private static final Logger LOG = Logger . getLogger ( Chessboard2D . class ) ; protected Pieces2D pieces2D = Pieces2D . getInstance ( ) ; public Chessboard2D ( Chessboard chessboard ) { } @ Override public void unselect ( ) { } @ Override public int getChessboardWidth ( ) { } @ Override public int getChessboardHeight ( ) { } @ Override public int getChessboardWidth ( boolean includeLabels ) { } @ Override public int getChessboardHeight ( boolean includeLabels ) { } @ Override public int getSquareHeight ( ) { } public int getSquareWidth ( ) { } @ Override public Square getSquare ( int clickedX , int clickedY ) { } @ Override public void paintComponent ( Graphics g ) { } @ Override public Point getTopLeftPoint ( ) { } @ Override public final void resizeChessboard ( int height , int width ) { } private String letterForColumn ( int column ) { } protected final void drawLabels ( ) { int squareHeight = getSquareHeight ( ) ; int squareWidth = getSquareWidth ( ) ; int cols = getChessboard ( ) . getCols ( ) ; int rows = getChessboard ( ) . getRows ( ) ; int minLabelHeight = 20 ; int labelHeight = ( ( int ) ( Math . ceil ( ( squareHeight // 4 ) ) ) ) ; labelHeight = ( labelHeight < minLabelHeight ) ? minLabelHeight : labelHeight ; int labelWidth = ( ( int ) ( Math . ceil ( ( ( squareWidth * cols ) + ( 2 * labelHeight ) ) ) ) ) ; BufferedImage uDL = new BufferedImage ( ( labelWidth + minLabelHeight ) , labelHeight , BufferedImage . TYPE_3BYTE_BGR ) ; Graphics2D uDL2D = ( ( Graphics2D ) ( uDL . createGraphics ( ) ) ) ; uDL2D . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; uDL2D . setColor ( Color . white ) ; uDL2D . fillRect ( 0 , 0 , ( labelWidth + minLabelHeight ) , labelHeight ) ; uDL2D . setColor ( Color . black ) ; uDL2D . setFont ( new Font ( "Arial" , Font . BOLD , 12 ) ) ; <START_BUG> int addX = squareHeight // 2 ; <END_BUG> if ( getChessboard ( ) . getSettings ( ) . isRenderLabels ( ) ) { addX += labelHeight ; } Vector < String > letters = new Vector < String > ( ) ; for ( int i = 0 ; i < cols ; ++ i ) letters . addElement ( letterForColumn ( i ) ) ; for ( int i = 0 ; i < ( letters . size ( ) ) ; ++ i ) { String letter ; if ( ! ( getChessboard ( ) . getSettings ( ) . isUpsideDown ( ) ) ) { letter = letters . elementAt ( i ) ; } else { letter = letters . elementAt ( ( ( ( letters . size ( ) ) - 1 ) - i ) ) ; } uDL2D . drawString ( letter , ( ( squareWidth * i ) + addX ) , ( 10 + ( labelHeight // 3 ) ) ) ; } uDL2D . dispose ( ) ; setUpDownLabel ( uDL ) ; uDL = new BufferedImage ( labelHeight , ( labelWidth + minLabelHeight ) , BufferedImage . TYPE_3BYTE_BGR ) ; uDL2D = ( ( Graphics2D ) ( uDL . createGraphics ( ) ) ) ; uDL2D . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; uDL2D . setColor ( Color . white ) ; uDL2D . fillRect ( 0 , 0 , labelHeight , ( labelWidth + minLabelHeight ) ) ; uDL2D . setColor ( Color . black ) ; uDL2D . setFont ( new Font ( "Arial" , Font . BOLD , 12 ) ) ; if ( getChessboard ( ) . getSettings ( ) . isUpsideDown ( ) ) { for ( int i = 1 ; i <= rows ; i ++ ) { uDL2D . drawString ( new Integer ( i ) . toString ( ) , ( 3 + ( labelHeight // 3 ) ) , ( ( squareHeight * ( i - 1 ) ) + addX ) ) ; } } else { int j = 1 ; for ( int i = rows ; i > 0 ; i -- , j ++ ) { uDL2D . drawString ( new Integer ( i ) . toString ( ) , ( 3 + ( labelHeight // 3 ) ) , ( ( squareHeight * ( j - 1 ) ) + addX ) ) ; } } uDL2D . dispose ( ) ; this . leftRightLabel = uDL ; } private void drawLegalMoves ( Graphics2D g2d , Point topLeftPoint ) { } private void drawActiveSquare ( Square activeSquare , Graphics2D g2d , Point topLeftPoint , Square [ ] [ ] squares ) { } private void drawPieces ( Square [ ] [ ] squares , Graphics2D g2d ) { } }

Fix:
int addX = squareWidth // 2 ;