diff --git a/src/main/java/de/tims/gameexplorer/GameExplorer.java b/src/main/java/de/tims/gameexplorer/GameExplorer.java index f78f205..cba4803 100644 --- a/src/main/java/de/tims/gameexplorer/GameExplorer.java +++ b/src/main/java/de/tims/gameexplorer/GameExplorer.java @@ -97,6 +97,7 @@ public class GameExplorer { logoutBtn.addActionListener(new LogoutAction()); exitBtn = new JButton("Exit"); exitBtn.setPreferredSize(smallBtnSize); + exitBtn.addActionListener(new ExitAction()); border1 = new JPanel(); border1.setOpaque(false); @@ -338,6 +339,15 @@ public class GameExplorer { } } + private class ExitAction implements ActionListener { + @Override + public void actionPerformed(ActionEvent e) { + manager.savePlayers(PLAYER_FILE); + + System.exit(0); + } + } + private class BackAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) {