button.length will be equal to 9 since you defined an array of 9 elements
private static JButton [] button = new JButton[9];
How can you do this if ( button.length == setEnabled(false))
comparision in if loop,
setEnabled(false)
is going to disable the JFrame and the return type is void,here you are comparing the int with void that's why the error is thrown at the compile time.
int i;
for(i=0;i<button.length;i++){
if(b[i].isEnabled()){
break;
}
}
if(i==button.length){
JOptionPane.showMessageDialog(null,"This was a Draw");
}