From bcbb9c15d379b4c053f4ae7258c9e4d989ae009f Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Thu, 12 Jan 2023 17:55:24 +0100 Subject: [PATCH] added if statement to restart button functionality --- src/main/java/Gui/ActionHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/Gui/ActionHandler.java b/src/main/java/Gui/ActionHandler.java index e32747c..3f32cd8 100644 --- a/src/main/java/Gui/ActionHandler.java +++ b/src/main/java/Gui/ActionHandler.java @@ -16,9 +16,11 @@ public class ActionHandler implements ActionListener { System.exit(0); } - GameGui.questionNr = 0; - GameGui.LosingPanel.setVisible(false); - restartGame.startGame(); + if (e.getSource() == GameGui.RestartBtn) { + GameGui.questionNr = 0; + GameGui.LosingPanel.setVisible(false); + restartGame.startGame(); + } }