Example usage for java.awt.event WindowEvent WINDOW_GAINED_FOCUS

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

Introduction

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

Prototype

int WINDOW_GAINED_FOCUS

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

Click Source Link

Document

The window-gained-focus event type.

Usage

From source file:Main.java

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