src/gui/GUI.java
public static Component createContentComponents() {

        // Create a panel to set up the board buttons.
        panelBoardNumbers = new JPanel();
        panelBoardNumbers.setLayout(new GridLayout(1, NUM_OF_COLUMNS, NUM_OF_ROWS, 4));
        panelBoardNumbers.setBorder(BorderFactory.createEmptyBorder(2, 22, 2, 22));

        for (JButton button : buttons) {
            panelBoardNumbers.add(button);
        }

        // main Connect-4 board creation
        layeredGameBoard = createLayeredBoard();

        // panel creation to store all the elements of the board
        panelMain = new JPanel();
        panelMain.setLayout(new BorderLayout());
        panelMain.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

        // add button and main board components to panelMain
        panelMain.add(panelBoardNumbers, BorderLayout.NORTH);
        panelMain.add(layeredGameBoard, BorderLayout.CENTER);

        frameMainWindow.setResizable(false);
        return panelMain;
    }
/**
     * It returns a component to be drawn by main window.
     * This function creates the main window components.
     * It calls the "actionListener" function, when a click on a button is made.
     */
It returns a component to be drawn by main window.
This function creates the main window components.
It calls the "actionListener" function, when a click on a button is made.
It returns a component to be drawn by main window . This function creates the main window components . It calls the " actionListener " function when a click on a button is made .
public static Component createContentComponents() {
        panelBoardNumbers = new JPanel();
        panelBoardNumbers.setLayout(new GridLayout(1, NUM_OF_COLUMNS, NUM_OF_ROWS, 4));
        panelBoardNumbers.setBorder(BorderFactory.createEmptyBorder(2, 22, 2, 22));
        for (JButton button : buttons) {
            panelBoardNumbers.add(button);
        }
        layeredGameBoard = createLayeredBoard();
        panelMain = new JPanel();
        panelMain.setLayout(new BorderLayout());
        panelMain.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        panelMain.add(panelBoardNumbers, BorderLayout.NORTH);
        panelMain.add(layeredGameBoard, BorderLayout.CENTER);
        frameMainWindow.setResizable(false);
        return panelMain;
    }
public static Component createContentComponents ( ) { panelBoardNumbers = new JPanel ( ) ; panelBoardNumbers . setLayout ( new GridLayout ( 1 , NUM_OF_COLUMNS , NUM_OF_ROWS , 4 ) ) ; panelBoardNumbers . setBorder ( BorderFactory . createEmptyBorder ( 2 , 22 , 2 , 22 ) ) ; for ( JButton button : buttons ) { panelBoardNumbers . add ( button ) ; } layeredGameBoard = createLayeredBoard ( ) ; panelMain = new JPanel ( ) ; panelMain . setLayout ( new BorderLayout ( ) ) ; panelMain . setBorder ( BorderFactory . createEmptyBorder ( 5 , 5 , 5 , 5 ) ) ; panelMain . add ( panelBoardNumbers , BorderLayout . NORTH ) ; panelMain . add ( layeredGameBoard , BorderLayout . CENTER ) ; frameMainWindow . setResizable ( false ) ; return panelMain ; }
It returns a component to be drawn by main window.
It returns a component to be drawn by main window .
// Create a panel to set up the board buttons. // main Connect-4 board creation // panel creation to store all the elements of the board // add button and main board components to panelMain