if( button[i].setEnabled(false))
{
JOptionPane.showMessageDialog(null," Button is disables ");
break;
}
You are indeed trying to check a void type in a conditional statement, this can't be done. Since setEnabled returns void (nothing). What you should be doing is checking the getter method of 'Enabled', so:
if (!button[i].isEnabled()) {
JOptionPane.showMessageDialog(null," Button is disables ");
break;
}
Note the '!' before the statement, this makes it negative