Browse Source

Added functionality on button press for the seventh button

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

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

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