Browse Source

Added functionality on button press for the eighth button

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

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

@ -275,5 +275,23 @@ public class StartTicTacToeGame implements ActionListener{
player2button7Pressed = true;
}
}
else if(e.getSource() == button8) {
if(player1Turn) {
button8.setForeground(Color.black);
button8.setText("X");
button8.setFont(new Font("arial", Font.PLAIN, 30));
player2Turn();
button8.setEnabled(false);
player1button8Pressed = true;
}
else {
button8.setForeground(Color.black);
button8.setText("O");
button8.setFont(new Font("arial", Font.PLAIN, 30));
player1Turn();
button8.setEnabled(false);
player2button8Pressed = true;
}
}
}
}
Loading…
Cancel
Save