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