|
|
@ -293,5 +293,23 @@ public class StartTicTacToeGame implements ActionListener{ |
|
|
|
player2button8Pressed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(e.getSource() == button9) { |
|
|
|
if(player1Turn) { |
|
|
|
button9.setForeground(Color.black); |
|
|
|
button9.setText("X"); |
|
|
|
button9.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
player2Turn(); |
|
|
|
button9.setEnabled(false); |
|
|
|
player1button9Pressed = true; |
|
|
|
} |
|
|
|
else { |
|
|
|
button9.setForeground(Color.black); |
|
|
|
button9.setText("O"); |
|
|
|
button9.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
button9.setEnabled(false); |
|
|
|
player1Turn(); |
|
|
|
player2button9Pressed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |