Top Description Constructors Methods
java.awt.event

public abstract Class WindowAdapter

extends Object
implements WindowListener, WindowStateListener, WindowFocusListener
Class Inheritance
All Implemented Interfaces
java.awt.event.WindowFocusListener, java.util.EventListener, java.awt.event.WindowStateListener, java.awt.event.WindowListener
Known Direct Subclasses
javax.swing.ColorChooserDialog.Closer, javax.swing.JMenu.WinListener, javax.swing.plaf.basic.BasicToolBarUI.FrameListener, javax.swing.plaf.metal.MetalTitlePane.WindowHandler, sun.awt.im.CompositionArea.FrameWindowAdapter

An abstract adapter class for receiving window events. The methods in this class are empty. This class exists as convenience for creating listener objects.

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.

Authors
Carl Quinn, Amy Fowler, David Mendenhall
Since
1.1
See Also
WindowEvent, WindowListener, Tutorial: Writing a Window Listener

Constructor Summary

AccessConstructor and Description
protected
WindowAdapter()

Constructs a WindowAdapter.

Method Summary

Modifier and TypeMethod and Description
public void
windowActivated(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowActivated.

Invoked when a window is activated.
public void
windowClosed(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowClosed.

Invoked when a window has been closed.
public void
windowClosing(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowClosing.

Invoked when a window is in the process of being closed.
public void
windowDeactivated(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowDeactivated.

Invoked when a window is de-activated.
public void
windowDeiconified(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowDeiconified.

Invoked when a window is de-iconified.
public void
windowGainedFocus(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowFocusListener.windowGainedFocus.

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.
public void
windowIconified(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowIconified.

Invoked when a window is iconified.
public void
windowLostFocus(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowFocusListener.windowLostFocus.

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.
public void
windowOpened(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowListener.windowOpened.

Invoked when a window has been opened.
public void
windowStateChanged(WindowEvent
the event to be processed
e
)

Implements java.awt.event.WindowStateListener.windowStateChanged.

Invoked when a window state is changed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WindowAdapterback to summary
protected WindowAdapter()

Constructs a WindowAdapter.

Method Detail

windowActivatedback to summary
public void windowActivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowActivated.

Invoked when a window is activated.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowActivated.

the event to be processed

windowClosedback to summary
public void windowClosed(WindowEvent e)

Implements java.awt.event.WindowListener.windowClosed.

Invoked when a window has been closed.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowClosed.

the event to be processed

windowClosingback to summary
public void windowClosing(WindowEvent e)

Implements java.awt.event.WindowListener.windowClosing.

Invoked when a window is in the process of being closed. The close operation can be overridden at this point.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowClosing.

the event to be processed

windowDeactivatedback to summary
public void windowDeactivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeactivated.

Invoked when a window is de-activated.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowDeactivated.

the event to be processed

windowDeiconifiedback to summary
public void windowDeiconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeiconified.

Invoked when a window is de-iconified.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowDeiconified.

the event to be processed

windowGainedFocusback to summary
public void windowGainedFocus(WindowEvent e)

Implements java.awt.event.WindowFocusListener.windowGainedFocus.

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.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowFocusListener.windowGainedFocus.

the event to be processed

Since
1.4
windowIconifiedback to summary
public void windowIconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowIconified.

Invoked when a window is iconified.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowIconified.

the event to be processed

windowLostFocusback to summary
public void windowLostFocus(WindowEvent e)

Implements java.awt.event.WindowFocusListener.windowLostFocus.

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.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowFocusListener.windowLostFocus.

the event to be processed

Since
1.4
windowOpenedback to summary
public void windowOpened(WindowEvent e)

Implements java.awt.event.WindowListener.windowOpened.

Invoked when a window has been opened.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowOpened.

the event to be processed

windowStateChangedback to summary
public void windowStateChanged(WindowEvent e)

Implements java.awt.event.WindowStateListener.windowStateChanged.

Invoked when a window state is changed.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowStateListener.windowStateChanged.

the event to be processed

Since
1.4