From 56eee1c83b115795d71515ee5b65d5ef6b05c22f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 28 Jan 2009 00:56:43 +0100 Subject: [PATCH] Add window listener to main frame. --- .../pterodactylus/jkeytool/gui/swing/SwingInterface.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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(); + } + }); } /** -- 2.7.4