From 1b23a92b2a99d2a7b037f71ea0df76faa88b2e3b Mon Sep 17 00:00:00 2001 From: TRC9696 Date: Mon, 30 Jan 2023 17:18:22 +0100 Subject: [PATCH] Added functionality on button press for the seventh button --- src/main/java/game/StartTicTacToeGame.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/game/StartTicTacToeGame.java b/src/main/java/game/StartTicTacToeGame.java index 5220fea..a59815a 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/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; + } + } } } \ No newline at end of file