java.awt.event
Class WindowAdapter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.event.WindowAdapter
All Implemented Interfaces:
WindowFocusListener sample code for java.awt.event.WindowFocusListener definition code for java.awt.event.WindowFocusListener , WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener , WindowStateListener sample code for java.awt.event.WindowStateListener definition code for java.awt.event.WindowStateListener , EventListener sample code for java.util.EventListener definition code for java.util.EventListener
Direct Known Subclasses:
BasicToolBarUI.FrameListener sample code for javax.swing.plaf.basic.BasicToolBarUI.FrameListener definition code for javax.swing.plaf.basic.BasicToolBarUI.FrameListener , JMenu.WinListener sample code for javax.swing.JMenu.WinListener definition code for javax.swing.JMenu.WinListener

public abstract class WindowAdapter
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener , WindowStateListener sample code for java.awt.event.WindowStateListener definition code for java.awt.event.WindowStateListener , WindowFocusListener sample code for java.awt.event.WindowFocusListener definition code for java.awt.event.WindowFocusListener

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.

Since:
1.1
See Also:
WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent , WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener , Tutorial: Writing a Window Listener, Reference: The Java Class Libraries (update file)

Constructor Summary
WindowAdapter sample code for java.awt.event.WindowAdapter.WindowAdapter() definition code for java.awt.event.WindowAdapter.WindowAdapter() ()
           
 
Method Summary
 void windowActivated sample code for java.awt.event.WindowAdapter.windowActivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowActivated(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window is activated.
 void windowClosed sample code for java.awt.event.WindowAdapter.windowClosed(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowClosed(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window has been closed.
 void windowClosing sample code for java.awt.event.WindowAdapter.windowClosing(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowClosing(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window is in the process of being closed.
 void windowDeactivated sample code for java.awt.event.WindowAdapter.windowDeactivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowDeactivated(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window is de-activated.
 void windowDeiconified sample code for java.awt.event.WindowAdapter.windowDeiconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowDeiconified(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window is de-iconified.
 void windowGainedFocus sample code for java.awt.event.WindowAdapter.windowGainedFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowGainedFocus(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          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.
 void windowIconified sample code for java.awt.event.WindowAdapter.windowIconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowIconified(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window is iconified.
 void windowLostFocus sample code for java.awt.event.WindowAdapter.windowLostFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowLostFocus(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          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.
 void windowOpened sample code for java.awt.event.WindowAdapter.windowOpened(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowOpened(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window has been opened.
 void windowStateChanged sample code for java.awt.event.WindowAdapter.windowStateChanged(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowStateChanged(java.awt.event.WindowEvent) (WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
          Invoked when a window state is changed.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

WindowAdapter sample code for java.awt.event.WindowAdapter() definition code for java.awt.event.WindowAdapter()

public WindowAdapter()
Method Detail

windowOpened sample code for java.awt.event.WindowAdapter.windowOpened(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowOpened(java.awt.event.WindowEvent)

public void windowOpened(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window has been opened.

Specified by:
windowOpened sample code for java.awt.event.WindowListener.windowOpened(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowOpened(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowClosing sample code for java.awt.event.WindowAdapter.windowClosing(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowClosing(java.awt.event.WindowEvent)

public void windowClosing(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window is in the process of being closed. The close operation can be overridden at this point.

Specified by:
windowClosing sample code for java.awt.event.WindowListener.windowClosing(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowClosing(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowClosed sample code for java.awt.event.WindowAdapter.windowClosed(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowClosed(java.awt.event.WindowEvent)

public void windowClosed(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window has been closed.

Specified by:
windowClosed sample code for java.awt.event.WindowListener.windowClosed(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowClosed(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowIconified sample code for java.awt.event.WindowAdapter.windowIconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowIconified(java.awt.event.WindowEvent)

public void windowIconified(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window is iconified.

Specified by:
windowIconified sample code for java.awt.event.WindowListener.windowIconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowIconified(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener
See Also:
Frame.setIconImage(java.awt.Image) sample code for java.awt.Frame.setIconImage(java.awt.Image) definition code for java.awt.Frame.setIconImage(java.awt.Image)

windowDeiconified sample code for java.awt.event.WindowAdapter.windowDeiconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowDeiconified(java.awt.event.WindowEvent)

public void windowDeiconified(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window is de-iconified.

Specified by:
windowDeiconified sample code for java.awt.event.WindowListener.windowDeiconified(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowDeiconified(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowActivated sample code for java.awt.event.WindowAdapter.windowActivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowActivated(java.awt.event.WindowEvent)

public void windowActivated(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window is activated.

Specified by:
windowActivated sample code for java.awt.event.WindowListener.windowActivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowActivated(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowDeactivated sample code for java.awt.event.WindowAdapter.windowDeactivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowDeactivated(java.awt.event.WindowEvent)

public void windowDeactivated(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window is de-activated.

Specified by:
windowDeactivated sample code for java.awt.event.WindowListener.windowDeactivated(java.awt.event.WindowEvent) definition code for java.awt.event.WindowListener.windowDeactivated(java.awt.event.WindowEvent) in interface WindowListener sample code for java.awt.event.WindowListener definition code for java.awt.event.WindowListener

windowStateChanged sample code for java.awt.event.WindowAdapter.windowStateChanged(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowStateChanged(java.awt.event.WindowEvent)

public void windowStateChanged(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
Invoked when a window state is changed.

Specified by:
windowStateChanged sample code for java.awt.event.WindowStateListener.windowStateChanged(java.awt.event.WindowEvent) definition code for java.awt.event.WindowStateListener.windowStateChanged(java.awt.event.WindowEvent) in interface WindowStateListener sample code for java.awt.event.WindowStateListener definition code for java.awt.event.WindowStateListener
Since:
1.4

windowGainedFocus sample code for java.awt.event.WindowAdapter.windowGainedFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowGainedFocus(java.awt.event.WindowEvent)

public void windowGainedFocus(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
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.

Specified by:
windowGainedFocus sample code for java.awt.event.WindowFocusListener.windowGainedFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowFocusListener.windowGainedFocus(java.awt.event.WindowEvent) in interface WindowFocusListener sample code for java.awt.event.WindowFocusListener definition code for java.awt.event.WindowFocusListener
Since:
1.4

windowLostFocus sample code for java.awt.event.WindowAdapter.windowLostFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowAdapter.windowLostFocus(java.awt.event.WindowEvent)

public void windowLostFocus(WindowEvent sample code for java.awt.event.WindowEvent definition code for java.awt.event.WindowEvent  e)
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.

Specified by:
windowLostFocus sample code for java.awt.event.WindowFocusListener.windowLostFocus(java.awt.event.WindowEvent) definition code for java.awt.event.WindowFocusListener.windowLostFocus(java.awt.event.WindowEvent) in interface WindowFocusListener sample code for java.awt.event.WindowFocusListener definition code for java.awt.event.WindowFocusListener
Since:
1.4