Java Reference
In-Depth Information
Display 18.1
Methods in the
Interface
WindowListener
The
WindowListener
interface and the
WindowEvent
class are in the package
java.awt.event
.
public void windowOpened(WindowEvent e)
Invoked when a window has been opened.
public void windowClosing(WindowEvent e)
Invoked when a window is in the process of being closed. Clicking the close-window button causes
an invocation of this method.
public void windowClosed(WindowEvent e)
Invoked when a window has been closed.
public void windowIconified(WindowEvent e)
Invoked when a window is iconified. When you click the minimize button in a
JFrame
, it is iconified.
public void windowDeiconified(WindowEvent e)
Invoked when a window is deiconified. When you activate a minimized window, it is deiconified.
public void windowActivated(WindowEvent e)
Invoked when a window is activated. When you click in a window, it becomes the activated window.
Other actions can also activate a window.
public void windowDeactivated(WindowEvent e)
Invoked when a window is deactivated. When a window is activated, all other windows are deacti-
vated. Other actions can also deactivate a window.
The
Interface
WindowListener
When the user clicks any of the three standard
buttons (for closing the window, min-
imizing the window, and resizing the window), that generates a window event. Window
events are sent to window listeners. In order to be a window listener, a class must imple-
ment the
JFrame
WindowListener
interface. The method headings for the
WindowListener
inter-
face are given in Display 18.1.
 
Search WWH ::




Custom Search