JPanel gridPanel = new JPanel(new GridLayout(ROWS, COLUMNS));
// Populate the GridLayout with buttons
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLUMNS; j++) {
buttonArray[i][j] = new XOButton();
buttonArray[i][j].addActionListener(new XOButtonListener(this));
gridPanel.add(buttonArray[i][j], BorderLayout.WEST);
}
}
//