posted 21 years ago
Sorry guys, I am new in Swing. Really need help on this one.
I created a 4X4 buttons
for (int i = 1; i <= 16; i++){
gameButton = new JButton();
gameButton.setPreferredSize(new Dimension(110,110));
gameButton.setBackground(new Color(225,220,175));
gameButton.setEnabled(false);
centerPanel.add(gameButton);
}
Right now all buttons are disabled. I just want to andomly pick one of those
buttons and enable it. Other buttons still preserve disabled. How to do that?
Thank you very much.