From: David ‘Bombe’ Roden Date: Tue, 27 Jan 2009 23:56:43 +0000 (+0100) Subject: Add window listener to main frame. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=56eee1c83b115795d71515ee5b65d5ef6b05c22f;p=jkeytool.git Add window listener to main frame. --- 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(); + } + }); } /**