Extend this class to create a WindowEvent
listener
and override the methods for the events of interest. (If you implement the
WindowListener
interface, you have to define all of
the methods in it. This abstract class defines null methods for them
all, so you can only have to define methods for events you care about.)
Create a listener object using the extended class and then register it with
a Window using the window's addWindowListener
method. When the window's status changes by virtue of being opened,
closed, activated or deactivated, iconified or deiconified,
the relevant method in the listener
object is invoked, and the WindowEvent
is passed to it.
WindowEvent
, WindowListener
, Tutorial: Writing a Window Listener
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public void | windowActivated(WindowEvent
the event to be processed e)Implements java. |
public void | windowClosed(WindowEvent
the event to be processed e)Implements java. |
public void | windowClosing(WindowEvent
the event to be processed e)Implements java. |
public void | windowDeactivated(WindowEvent
the event to be processed e)Implements java. |
public void | windowDeiconified(WindowEvent
the event to be processed e)Implements java. |
public void | windowGainedFocus(WindowEvent
the event to be processed e)Implements java. |
public void | windowIconified(WindowEvent
the event to be processed e)Implements java. |
public void | windowLostFocus(WindowEvent
the event to be processed e)Implements java. |
public void | windowOpened(WindowEvent
the event to be processed e)Implements java. |
public void | windowStateChanged(WindowEvent
the event to be processed e)Implements java. |
WindowAdapter | back to summary |
---|---|
protected WindowAdapter() Constructs a |
windowActivated | back to summary |
---|---|
public void windowActivated(WindowEvent e) Implements java. Invoked when a window is activated.
|
windowClosed | back to summary |
---|---|
public void windowClosed(WindowEvent e) Implements java. Invoked when a window has been closed.
|
windowClosing | back to summary |
---|---|
public void windowClosing(WindowEvent e) Implements java. Invoked when a window is in the process of being closed. The close operation can be overridden at this point.
|
windowDeactivated | back to summary |
---|---|
public void windowDeactivated(WindowEvent e) Implements java. Invoked when a window is de-activated.
|
windowDeiconified | back to summary |
---|---|
public void windowDeiconified(WindowEvent e) Implements java. Invoked when a window is de-iconified.
|
windowGainedFocus | back to summary |
---|---|
public void windowGainedFocus(WindowEvent e) Implements java. Invoked when the Window is set to be the focused Window, which means that the Window, or one of its subcomponents, will receive keyboard events.
|
windowIconified | back to summary |
---|---|
public void windowIconified(WindowEvent e) Implements java. Invoked when a window is iconified.
|
windowLostFocus | back to summary |
---|---|
public void windowLostFocus(WindowEvent e) Implements java. Invoked when the Window is no longer the focused Window, which means that keyboard events will no longer be delivered to the Window or any of its subcomponents.
|
windowOpened | back to summary |
---|---|
public void windowOpened(WindowEvent e) Implements java. Invoked when a window has been opened.
|
windowStateChanged | back to summary |
---|---|
public void windowStateChanged(WindowEvent e) Implements java. Invoked when a window state is changed.
|