This is my if statement…
The buttons show up like this:

This is my if statement
if((buttons[3].getName()=="x" && buttons[6].getName()=="x" &&
buttons[9].getText()=="x")||(buttons[2].getName()=="x" &&
buttons[5].getName()=="x" && buttons[8].getName()=="x")||
((buttons[1].getName()=="x") && (buttons[4].getName()=="x") &&
(buttons[7].getName()=="x"))){
JOptionPane.showMessageDialog(null,"X Wins");
}
So if I select the 1st, 4th and 7th buttons (the left most 3 buttons) why does it not say “X Wins”?
As a sidenote, yes the buttons should have the name “x”
Comparison between strings use equals().
Also, you make sure that the 3 of the left are 1, 4 and 7 and not 0, 3 and 6, right?