Since java.awt.Window is a subclass of
java.awt.Component, a Window,
Frame or Dialog can fire events. In particular
it fires WindowEvents. There are seven of these:
WindowEvent.WINDOW_ACTIVATEDWindowEvent.WINDOW_CLOSEDWindowEvent.WINDOW_CLOSINGWindowEvent.WINDOW_DEACTIVATEDWindowEvent.WINDOW_DEICONIFIEDWindowEvent.WINDOW_ICONIFIEDWindowEvent.WINDOW_OPENED
To respond to these events you register a
WindowListener object with the window. The object must
implement the WindowListener interface and include
these methods:
public void windowOpened(WindowEvent evt)
public void windowClosing(WindowEvent evt)
public void windowClosed(WindowEvent evt)
public void windowIconified(WindowEvent evt)
public void windowDeiconified(WindowEvent evt)
public void windowActivated(WindowEvent evt)
public void windowDeactivated(WindowEvent evt)