Example usage for java.awt.event WindowEvent WINDOW_LOST_FOCUS

List of usage examples for java.awt.event WindowEvent WINDOW_LOST_FOCUS

Introduction

In this page you can find the example usage for java.awt.event WindowEvent WINDOW_LOST_FOCUS.

Prototype

int WINDOW_LOST_FOCUS

To view the source code for java.awt.event WindowEvent WINDOW_LOST_FOCUS.

Click Source Link

Document

The window-lost-focus event type.

Usage

From source file:Main.java

protected void processWindowEvent(WindowEvent e) {
    if (e.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
        System.out.println(WindowEvent.WINDOW_LOST_FOCUS);
        dispose();//from w  ww .j ava  2s  . c  o  m
        System.exit(0);
    }
    super.processWindowEvent(e); // Pass on the event
}