Code example for WindowEvent

Methods: getWindow

0
     * Listens for the main window closing, and shuts down the application. 
     * 
     * @param event  information about the window event. 
     */ 
    public void windowClosing(final WindowEvent event) {
        if (event.getWindow() == this) {
            dispose();
            System.exit(0);
        } 
    } 
 
    /** 
     * Required for WindowListener interface, but not used by this class. 
     * 
     * @param event  information about the window event. 
     */ 
    public void windowClosed(final WindowEvent event) {
        // ignore 
    }