diff --git a/src/main/java/Gui/ActionHandler.java b/src/main/java/Gui/ActionHandler.java index c435468..070d9e3 100644 --- a/src/main/java/Gui/ActionHandler.java +++ b/src/main/java/Gui/ActionHandler.java @@ -9,6 +9,11 @@ public class ActionHandler implements ActionListener { if (e.getSource() == gui.CloseBtn) { System.exit(0); } + + if (e.getSource() == GameGui.ClosingBtn) { + System.exit(0); + } + } } diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 9943c8d..065dfe9 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -144,5 +144,6 @@ GridBagConstraints gbc; LosingPanel.add(ClosingBtn,gbc); RestartBtn.addActionListener(new RestartGame()); + ClosingBtn.addActionListener(new ActionHandler()); } }