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