X-Git-Url: https://git.pterodactylus.net/?p=jkeytool.git;a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2Fswing%2FSwingInterface.java;h=7e3e300b65f831dd6a76c7ccb55cdba29ccc2cd2;hp=165a6d6ab791620aa2e1c679a0830d75ee10376d;hb=HEAD;hpb=635f9f61a4620cf7911a022c49434a4660346e57 diff --git a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java index 165a6d6..7e3e300 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java @@ -21,6 +21,8 @@ package net.pterodactylus.jkeytool.gui.swing; import java.awt.BorderLayout; import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.io.File; import java.security.KeyStore; import java.util.HashMap; @@ -137,6 +139,17 @@ public class SwingInterface implements Interface { mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER); mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END); mainFrame.pack(); + mainFrame.addWindowListener(new WindowAdapter() { + + /** + * {@inheritDoc} + */ + @Override + @SuppressWarnings("synthetic-access") + public void windowClosing(WindowEvent windowEvent) { + quit(); + } + }); } /**