List of usage examples for java.awt.event WindowListener WindowListener
WindowListener
From source file:org.jets3t.apps.cockpit.Cockpit.java
/** * Runs Cockpit as a stand-alone application. * @param args/*ww w .j a v a 2s . c o m*/ * @throws Exception */ public static void main(String args[]) throws Exception { // When running on OS X, display app menu in the right place (i.e. not the app window) System.setProperty("apple.laf.useScreenMenuBar", "true"); JFrame ownerFrame = new JFrame("JetS3t Cockpit"); ownerFrame.addWindowListener(new WindowListener() { public void windowOpened(WindowEvent e) { } public void windowClosing(WindowEvent e) { e.getWindow().dispose(); } public void windowClosed(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowDeiconified(WindowEvent e) { } public void windowActivated(WindowEvent e) { } public void windowDeactivated(WindowEvent e) { } }); new Cockpit(ownerFrame); }