From 74c9ce244a386bb3f9ee76dfbe953f81bd08dd0f Mon Sep 17 00:00:00 2001 From: TRC9696 Date: Mon, 30 Jan 2023 17:17:10 +0100 Subject: [PATCH] Added functionality on button press for the sixth 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 028c439..5220fea 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/src/main/java/game/StartTicTacToeGame.java @@ -239,5 +239,23 @@ public class StartTicTacToeGame implements ActionListener{ player2button5Pressed = true; } } + else if(e.getSource() == button6) { + if(player1Turn) { + button6.setForeground(Color.black); + button6.setText("X"); + button6.setFont(new Font("arial", Font.PLAIN, 30)); + player2Turn(); + button6.setEnabled(false); + player1button6Pressed = true; + } + else { + button6.setForeground(Color.black); + button6.setText("O"); + button6.setFont(new Font("arial", Font.PLAIN, 30)); + player1Turn(); + button6.setEnabled(false); + player2button6Pressed = true; + } + } } } \ No newline at end of file