I am trying to build a TicTacToe game and to draw the game every element in my 2d array should be disabled. How to find out if all of my my JButtons in my array is disabled.Here I assigned I created JButton.
for(int row = 0; row < buttons.length; row++){
for(int column = 0; column<buttons[row].length; column++){
buttons[row][column] = new JButton();
this.add(buttons[row][column]);
buttons[row][column].addActionListener(new tickSquare());
}
}
and here I tried to do looping but it does if everything is disabled
for(int row = 0; row < buttons.length; row++){
for(int column = 0; column<buttons[row].length; column++){
if(buttons[row][column].isEnabled() == false){
JOptionPane.showMessageDialog(null,labelD);
}
}
}