Browse Source

gameexplorer_gui: added actionListener for exit button

gameexplorer_gui
Tobias Krause 3 years ago
committed by Lorenz Hohmann
parent
commit
bea41ebeb4
  1. 10
      src/main/java/de/tims/gameexplorer/GameExplorer.java

10
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) {

Loading…
Cancel
Save