src/gui/GUI.java
public static JLayeredPane createLayeredBoard() {
        layeredGameBoard = new JLayeredPane();

        ImageIcon imageBoard = null;
        if (gameParameters.getCheckersInARow() == CONNECT_4_CHECKERS_IN_A_ROW) {
            layeredGameBoard.setPreferredSize(new Dimension(DEFAULT_CONNECT_4_WIDTH, DEFAULT_CONNECT_4_HEIGHT));
            layeredGameBoard.setBorder(BorderFactory.createTitledBorder("Connect-4"));
            imageBoard = new ImageIcon(ResourceLoader.load(CONNECT_4_BOARD_IMG_PATH));
        } else if (gameParameters.getCheckersInARow() == CONNECT_5_CHECKERS_IN_A_ROW) {
            layeredGameBoard.setPreferredSize(new Dimension(DEFAULT_CONNECT_5_WIDTH, DEFAULT_CONNECT_5_HEIGHT));
            layeredGameBoard.setBorder(BorderFactory.createTitledBorder("Connect-5"));
            imageBoard = new ImageIcon(ResourceLoader.load(CONNECT_5_BOARD_IMG_PATH));
        }

        JLabel imageBoardLabel = new JLabel(imageBoard);

        imageBoardLabel.setBounds(20, 20, imageBoard.getIconWidth(), imageBoard.getIconHeight());
        layeredGameBoard.add(imageBoardLabel, 0, 1);

        return layeredGameBoard;
    }
// This is the main Connect-4 board.
This is the main Connect-4 board.
This is the main Connect - 4 board .
public static JLayeredPane createLayeredBoard() {
        layeredGameBoard = new JLayeredPane();
        ImageIcon imageBoard = null;
        if (gameParameters.getCheckersInARow() == CONNECT_4_CHECKERS_IN_A_ROW) {
            layeredGameBoard.setPreferredSize(new Dimension(DEFAULT_CONNECT_4_WIDTH, DEFAULT_CONNECT_4_HEIGHT));
            layeredGameBoard.setBorder(BorderFactory.createTitledBorder("Connect-4"));
            imageBoard = new ImageIcon(ResourceLoader.load(CONNECT_4_BOARD_IMG_PATH));
        } else if (gameParameters.getCheckersInARow() == CONNECT_5_CHECKERS_IN_A_ROW) {
            layeredGameBoard.setPreferredSize(new Dimension(DEFAULT_CONNECT_5_WIDTH, DEFAULT_CONNECT_5_HEIGHT));
            layeredGameBoard.setBorder(BorderFactory.createTitledBorder("Connect-5"));
            imageBoard = new ImageIcon(ResourceLoader.load(CONNECT_5_BOARD_IMG_PATH));
        }
        JLabel imageBoardLabel = new JLabel(imageBoard);
        imageBoardLabel.setBounds(20, 20, imageBoard.getIconWidth(), imageBoard.getIconHeight());
        layeredGameBoard.add(imageBoardLabel, 0, 1);
        return layeredGameBoard;
    }
public static JLayeredPane createLayeredBoard ( ) { layeredGameBoard = new JLayeredPane ( ) ; ImageIcon imageBoard = null ; if ( gameParameters . getCheckersInARow ( ) == CONNECT_4_CHECKERS_IN_A_ROW ) { layeredGameBoard . setPreferredSize ( new Dimension ( DEFAULT_CONNECT_4_WIDTH , DEFAULT_CONNECT_4_HEIGHT ) ) ; layeredGameBoard . setBorder ( BorderFactory . createTitledBorder ( "Connect-4" ) ) ; imageBoard = new ImageIcon ( ResourceLoader . load ( CONNECT_4_BOARD_IMG_PATH ) ) ; } else if ( gameParameters . getCheckersInARow ( ) == CONNECT_5_CHECKERS_IN_A_ROW ) { layeredGameBoard . setPreferredSize ( new Dimension ( DEFAULT_CONNECT_5_WIDTH , DEFAULT_CONNECT_5_HEIGHT ) ) ; layeredGameBoard . setBorder ( BorderFactory . createTitledBorder ( "Connect-5" ) ) ; imageBoard = new ImageIcon ( ResourceLoader . load ( CONNECT_5_BOARD_IMG_PATH ) ) ; } JLabel imageBoardLabel = new JLabel ( imageBoard ) ; imageBoardLabel . setBounds ( 20 , 20 , imageBoard . getIconWidth ( ) , imageBoard . getIconHeight ( ) ) ; layeredGameBoard . add ( imageBoardLabel , 0 , 1 ) ; return layeredGameBoard ; }
This is the main Connect-4 board.
This is the main Connect - 4 board .