From 55cd6e1609124fba51d5a2f36fb69b00808e0f53 Mon Sep 17 00:00:00 2001 From: TRC9696 Date: Mon, 30 Jan 2023 17:19:55 +0100 Subject: [PATCH] Added functionality on button press for the eighth 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 a59815a..d39024a 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/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; + } + } } } \ No newline at end of file