Example usage for java.awt Event WINDOW_DESTROY

List of usage examples for java.awt Event WINDOW_DESTROY

Introduction

In this page you can find the example usage for java.awt Event WINDOW_DESTROY.

Prototype

int WINDOW_DESTROY

To view the source code for java.awt Event WINDOW_DESTROY.

Click Source Link

Document

The user has asked the window manager to kill the window.

Usage

From source file:ClipMe.java

public boolean handleEvent(Event e) {
    if (e.id == Event.WINDOW_DESTROY) {
        System.exit(0);//from   w w w  . j a v  a 2  s .c o m
        return true; // never gets here
    }
    return super.handleEvent(e);
}

From source file:DummyAppletContext.java

/**
 * Event handler to catch the Frame (window) close action,
 * and exit the program./*from w  w w  .  j  a  va  2  s.co  m*/
 *
 * @param evt   The event that occurred
 * @return      false if the event was not handled by this object.
 */
public boolean handleEvent(Event evt) {

    if (evt.id == Event.WINDOW_DESTROY) {
        System.exit(0);
    }

    return super.handleEvent(evt);
}