import java.awt.event.*; public class WindowEventHandler implements WindowListener { private void showEvent(WindowEvent we) { System.out.println(we + "/" + we.getWindow().getClass()); } public void windowActivated(WindowEvent we) { showEvent(we); } public void windowDeactivated(WindowEvent we) { showEvent(we); } public void windowIconified(WindowEvent we) { showEvent(we); } public void windowDeiconified(WindowEvent we) { showEvent(we); } public void windowOpened(WindowEvent we) { showEvent(we); } public void windowClosed(WindowEvent we) { showEvent(we); } public void windowClosing(WindowEvent we) { showEvent(we); we.getWindow().dispose(); System.exit(0); } }