List of usage examples for java.awt.event WindowEvent WINDOW_LOST_FOCUS
int WINDOW_LOST_FOCUS
To view the source code for java.awt.event WindowEvent WINDOW_LOST_FOCUS.
Click Source Link
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 }