Browse Source

Added functionality on button press for the fifth button

master
TRC9696 2 years ago
parent
commit
fe7dd02474
  1. 18
      src/main/java/game/StartTicTacToeGame.java

18
src/main/java/game/StartTicTacToeGame.java

@ -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;
}
}
}
}
Loading…
Cancel
Save