Generated by
JDiff

java.awt.event Documentation Differences

This file contains all the changes in documentation in the package java.awt.event as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AWTEventListener

The listener interface for receiving notification of events dispatched to objects that are instances of Component or MenuComponent or their subclasses. Unlike the other EventListeners in this package AWTEventListeners passively observe events being dispatched in the AWT system-wide. Most applications should never use this class; applications which might use AWTEventListeners include event recorders for automated testing and facilities such as the Java Accessibility package.

The class that is interested in monitoring AWT events implements this interface and the object created with that class is registered with the Toolkit using the Toolkit's addAWTEventListener method. When an event is dispatched anywhere in the AWT that object's eventDispatcheded method is invoked. @see java.awt.AWTEvent @see java.awt.Toolkit#addAWTEventListener @see java.awt.Toolkit#removeAWTEventListener @author Fred Ecks @version 1.6 027 12/0203/0001 @since 1.2


Class ActionEvent

A semantic event which indicates that a component-defined action occured. This high-level event is generated by a component (such as a Button) when the component-specific action occurs (such as being pressed). The event is passed to every every ActionListener object that registered to receive such events using the component's addActionListener method.

The object that implements the ActionListener interface gets this ActionEvent when the event occurs. The listener is therefore spared the details of processing individual mouse movements and mouse clicks and can instead process a "meaningful" (semantic) event like "button pressed". @see ActionListener @see Tutorial: Java 1.1 Event Model @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.21 0224 12/0203/0001 @since 1.1

Class ActionEvent, constructor ActionEvent(Object, int, String)

Constructs an ActionEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the object that originated the event @param id an integer that identifies the event @param command a string that may specify a command (possibly one of several) associated with the event

Class ActionEvent, constructor ActionEvent(Object, int, String, int)

Constructs an ActionEvent object with modifier keys.

Note that passing in an invalid id results in unspecified behavior. @param source the object that originated the event @param id an integer that identifies the event @param command a string that may specify a command (possibly one of several) associated with the event @param modifiers the modifier keys held down during this action

Class ActionEvent, int getModifiers()

Returns the modifier keys held down during this action event. @return the integerbitwise-or sum of the modifier constants

Class ActionListener

The listener interface for receiving action events. The class that is interested in processing an action event implements this interface and the object created with that class is registered with a component using the component's addActionListener method. When the action event occurs that object's actionPerformed method is invoked. @see ActionEvent @see Tutorial: Java 1.1 Event Model @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.13 0214 12/0203/0001 @since 1.1

Class AdjustmentEvent

The adjustment event emitted by Adjustable objects. @see java.awt.Adjustable @see AdjustmentListener @author Amy Fowler @version 1.21 0224 12/0203/0001 @since 1.1
Class AdjustmentEvent, constructor AdjustmentEvent(Adjustable, int, int, int)

Constructs aan AdjustmentEvent object with the specified Adjustable source event type adjustment type and value. type

Note andthat valuepassing in an invalid id results in unspecified behavior. @param source the Adjustable object where the event originated @param id the event type @param type the adjustment type @param value the current value of the adjustment

Class AdjustmentEvent, Adjustable getAdjustable()

Returns the Adjustable object where this event originated. @return the Adjustable object where this event originated
Class AdjustmentEvent, int getAdjustmentType()

Returns the type of adjustment which caused the value changed event. It will have one of the following values: @return one of the adjustment values listed above
Class AdjustmentEvent, int getValue()

Returns the current value in the adjustment event. @return the current value in the adjustment event

Class AdjustmentListener

The listener interface for receiving adjustment events. @author Amy Fowler @version 1.11 0212 12/0203/0001 @since 1.1

Class ComponentAdapter

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

Extend this class to create a ComponentEvent listener and override the methods for the events of interest. (If you implement the ComponentListener 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 your class and then register it with a component using the component's addComponentListener method. When the component's size location or visibility changes the relevant method in the listener object is invoked and the ComponentEvent is passed to it. @see ComponentEvent @see ComponentListener @see Tutorial: Writing a Component Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.13 0214 12/0203/0001 @since 1.1


Class ComponentEvent

A low-level event which indicates that a component moved changed size or changed visibility (also the root class for the other component-level events).

Component events are provided for notification purposes ONLY; The AWT will automatically handle component moves and resizes internally so that GUI layout works properly regardless of whether a program is receiving these events or not.

In addition to serving as the base class for other component-related events (InputEvent FocusEvent WindowEvent ContainerEvent) this class defines the events that indicate changes in a component's size position or visibility.

This low-level event is generated by a component object (such as a List) when the component is moved resized rendered invisible or made visible again. The event is passed to every ComponentListener or ComponentAdapter object which registered to receive such events using the component's addComponentListener method. (ComponentAdapter objects implement the ComponentListener interface.) Each such listener object gets this ComponentEvent when the event occurs. @see ComponentAdapter @see ComponentListener @see Tutorial: Writing a Component Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.21 0224 12/0203/0001 @since 1.1

Class ComponentEvent, constructor ComponentEvent(Component, int)

Constructs a ComponentEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the Component object that originated the event @param id an integer indicating the type of event

Class ComponentEvent, Component getComponent()

Returns the originator of the event. @return the Component object that originated the event or null if the object is not a Component.

Class ComponentListener

The listener interface for receiving component events. The class that is interested in processing a component event either implements this interface (and all the methods it contains) or extends the abstract ComponentAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component's addComponentListener method. When the component's size location or visibility changes the relevant method in the listener object is invoked and the ComponentEvent is passed to it.

Component events are provided for notification purposes ONLY; The AWT will automatically handle component moves and resizes internally so that GUI layout works properly regardless of whether a program registers a ComponentListener or not. @see ComponentAdapter @see ComponentEvent @see Tutorial: Writing a Component Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.13 0214 12/0203/0001 @since 1.1


Class ContainerAdapter

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

Extend this class to create a ContainerEvent listener and override the methods for the events of interest. (If you implement the ContainerListener 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 component using the component's addContainerListener method. When the container's contents change because a component has been added or removed the relevant method in the listener object is invoked and the ContainerEvent is passed to it. @see ContainerEvent @see ContainerListener @see Tutorial: Writing a Container Listener @see Reference: The Java Class Libraries (update file) @author Amy Fowler @version 1.9 0210 12/0203/0001 @since 1.1


Class ContainerEvent

A low-level event which indicates that a container's contents changed because a component was added or removed.

Container events are provided for notification purposes ONLY; The AWT will automatically handle changes to the containers contents internally so that the program works properly regardless of whether the program is receiving these events or not.

This low-level event is generated by a container object (such as a Panel) when a component is added to it or removed from it. The event is passed to every ContainerListener or ContainerAdapter object which registered to receive such events using the component's addContainerListener method. (ContainerAdapter objects implement the ContainerListener interface.) Each such listener object gets this ContainerEvent when the event occurs. @see ContainerAdapter @see ContainerListener @see Tutorial: Writing a Container Listener @see Reference: The Java Class Libraries (update file) @author Tim Prinzing @author Amy Fowler @version 1.11 0213 12/0203/0001 @since 1.1

Class ContainerEvent, constructor ContainerEvent(Component, int, Component)

Constructs a ContainerEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the Component object (container) that originated the event @param id an integer indicating the type of event @param child the component that was added or removed


Class ContainerListener

The listener interface for receiving container events. The class that is interested in processing a container event either implements this interface (and all the methods it contains) or extends the abstract ContainerAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component's addContainerListener method. When the container's contents change because a component has been added or removed the relevant method in the listener object is invoked and the ContainerEvent is passed to it.

Container events are provided for notification purposes ONLY; The AWT will automatically handle add and remove operations internally so the program works properly regardless of whether the program registers a ComponentListener or not. @see ContainerAdapter @see ContainerEvent @see Tutorial: Writing a Container Listener @see Reference: The Java Class Libraries (update file) @author Tim Prinzing @author Amy Fowler @version 1.8 029 12/0203/0001 @since 1.1


Class FocusAdapter

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

Extend this class to create a FocusEvent listener and override the methods for the events of interest. (If you implement the FocusListener 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 component using the component's addFocusListener method. When the component gains or loses the keyboard focus the relevant method in the listener object is invoked and the FocusEvent is passed to it. @see FocusEvent @see FocusListener @see Tutorial: Writing a Focus Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.13 0214 12/0203/0001 @since 1.1


Class FocusEvent

A low-level event which indicates that a componentComponent has gained or lost the keyboardinput focus. This low-level event is generated by a componentComponent (such as a text fieldTextField). The event is passed to every FocusListener or FocusAdapter object which registered to receive such events using the componentComponent's addFocusListener method. ( FocusAdapter objects implement the FocusListener interface.) Each such listener object gets this FocusEvent when the event occurs.

There are two levels of focus change events: permanent and temporary. Permanent focus change events occur when focus is directly moved from one componentComponent to another such as through callsa call to requestFocus() or as the user uses the TabTAB key to traverse componentsComponents. Temporary focus change events occur when focus is temporarily gained or lost for a componentComponent as the indirect result of another operation such as windowWindow deactivation or a scrollbarScrollbar drag. In this case the original focus state will automatically be restored once that operation is finished or for the case of windowWindow deactivation when the windowWindow is reactivated. Both permanent and temporary focus events are delivered using the FOCUS_GAINED and FOCUS_LOST event ids; the levelslevel may be distinguished in the event using the isTemporary() method. @see FocusAdapter @see FocusListener @see Tutorial: Writing a Focus Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @author Amy Fowler @version 1.22 0225 12/0203/0001 @since 1.1

Class FocusEvent, constructor FocusEvent(Component, int)

Constructs a FocusEvent object and identifies it as a permanent change in focus.

Note that passing in an invalid id results in unspecified behavior. @param source the Component that originated the event @param id an integer indicating the type of event

Class FocusEvent, constructor FocusEvent(Component, int, boolean)

Constructs a FocusEvent object and identifies whether or not the change is temporary.

Note that passing in an invalid id results in unspecified behavior. @param source the Component that originated the event @param id an integer indicating the type of event @param temporary a boolean true if the focus change is temporary; false otherwise

Class FocusEvent, boolean isTemporary()

Identifies the focus change event as temporary or permanent. @return a boolean value true if the focus change is temporary; false otherwise
Class FocusEvent, int FOCUS_GAINED

This event indicates that the component gained the keyboardComponent is now the focus owner.
Class FocusEvent, int FOCUS_LOST

This event indicates that the component lostComponent is theno longer keyboardthe focus owner.

Class FocusListener

The listener interface for receiving keyboard focus events on a component. The class that is interested in processing a focus event either implements this interface (and all the methods it contains) or extends the abstract FocusAdapter class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component's addFocusListener method. When the component gains or loses the keyboard focus the relevant method in the listener object is invoked and the FocusEvent is passed to it. @see FocusAdapter @see FocusEvent @see Tutorial: Writing a Focus Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @version 1.12 0213 12/0203/0001 @since 1.1

Class HierarchyBoundsAdapter

An abstract adapter class for receiving ancestor moved and resized events. The methods in this class are empty. This class exists as a convenience for creating listener objects.

Extend this class and override the method for the event of interest. (If you implement the HierarchyBoundsListener interface you have to define both methods in it. This abstract class defines null methods for them both so you only have to define the method for the event you care about.)

Create a listener object using your class and then register it with a Component using the Component's addHierarchyBoundsListener method. When the hierarchy to which the Component belongs changes by resize or movement of an ancestor the relevant method in the listener object is invoked and the HierarchyEvent is passed to it. @author David Mendenhall @version 1.4 025 12/0203/0001 @see HierarchyBoundsListener @see HierarchyEvent @since 1.3


Class HierarchyBoundsListener

The listener interface for receiving ancestor moved and resized events. The class that is interested in processing these events either implements this interface (and all the methods it contains) or extends the abstract HierarchyBoundsAdapter class (overriding only the method of interest). The listener object created from that class is then registered with a Component using the Component's addHierarchyBoundsListener method. When the hierarchy to which the Component belongs changes by the resizing or movement of an ancestor the relevant method in the listener object is invoked and the HierarchyEvent is passed to it.

Hierarchy events are provided for notification purposes ONLY; The AWT will automatically handle changes to the hierarchy internally so that GUI layout works properly regardless of whether a program registers an HierarchyBoundsListener or not. @author David Mendenhall @version 1.4 025 12/0203/0001 @see HierarchyBoundsAdapter @see HierarchyEvent @since 1.3


Class HierarchyEvent

An event which indicates a change to the Component hierarchy to which a Component belongs.

Hierarchy events are provided for notification purposes ONLY;. The AWT will automatically handle changes to the hierarchy internally so that GUI layout and displayability works properly regardless of whether a program is receiving these events or not.

This event is generated by a Container object (such as a Panel) when the Container is added removed moved or resized and passed down the hierarchy. It is also generated by a Component object when that object's addNotify removeNotify show or hide method is called. ANCESTOR_MOVED and ANCESTOR_RESIZED events are dispatched to every HierarchyBoundsListener or HierarchyBoundsAdapter object which registered to receive such events using the Component's addHierarchyBoundsListener method. (HierarchyBoundsAdapter objects implement the HierarchyBoundsListener interface.) HIERARCHY_CHANGED events are dispatched to every HierarchyListener object which registered to receive such events using the Component's addHierarchyListener method. Each such listener object gets this HierarchyEvent when the event occurs. @author David Mendenhall @version 1.59 0212/0203/0001 @see HierarchyListener @see HierarchyBoundsAdapter @see HierarchyBoundsListener @since 1.3

Class HierarchyEvent, constructor HierarchyEvent(Component, int, Component, Container)

Constructs an HierarchyEvent object to identify a change in the Component hierarchy.

Note that passing in an invalid id results in unspecified behavior. @param source the Component object that originated the event @param id an integer indicating the type of event @param changed the Component at the top of the hierarchy which was changed @param changedParent the parent of changed. This; this may be the parent before or after the change depending on the type of change.

Class HierarchyEvent, constructor HierarchyEvent(Component, int, Component, Container, long)

Constructs an HierarchyEvent object to identify a change in the Component hierarchy.

Note that passing in an invalid id results in unspecified behavior. @param source the Component object that originated the event @param id an integer indicating the type of event @param changed the Component at the top of the hierarchy which was changed @param changedParent the parent of changed. This; this may be the parent before or after the change depending on the type of change. @param changeFlags a bitmask which indicates the type(s) of HIERARCHY_CHANGED events represented in this event object

Class HierarchyEvent, Component getComponent()

Returns the originator of the event. @return the Component object that originated the event or null if the object is not a Component.
Class HierarchyEvent, int ANCESTOR_MOVED

AnThe event id indicating an ancestor-Container was moved.
Class HierarchyEvent, int ANCESTOR_RESIZED

AnThe event id indicating an ancestor-Container was resized.
Class HierarchyEvent, int DISPLAYABILITY_CHANGED

TheIndicates that the HIERARCHY_CHANGED event was generated due to a change in the displayability of the hierarchy changed. To discern the current displayability of the hierarchy call Component.isDisplayable(). Displayability changes occur in response to explicit or implicit calls to Component.addNotify() and Component.removeNotify(). @see java.awt.Component#isDisplayable() @see java.awt.Component#addNotify() @see java.awt.Component#removeNotify()
Class HierarchyEvent, int HIERARCHY_CHANGED

AThe event id indicating that modification was made to the entire hierarchy tree.
Class HierarchyEvent, int PARENT_CHANGED

The hierarchy changedIndicates that the throughHIERARCHY_CHANGED event was generated by a reparentreparenting operation.
Class HierarchyEvent, int SHOWING_CHANGED

TheIndicates that the HIERARCHY_CHANGED event was generated due to a change in the showing state of the hierarchy changed. To discern the current showing state of the hierarchy call Component.isShowing(). Showing state changes occur when either the displayability or visibility of the hierarchy occurs. Displayability changes occur in response to explicit or implicit calls to Component.addNotify() and Component.removeNotify(). Visibility changes occur in response to explicit or implicit calls to Component.show() and Component.hide(). @see java.awt.Component#isShowing() @see java.awt.Component#addNotify() @see java.awt.Component#removeNotify() @see java.awt.Component#show() @see java.awt.Component#hide()

Class HierarchyListener

The listener interface for receiving hierarchy changed events. The class that is interested in processing a hierarchy changed event should implement this interface. The listener object created from that class is then registered with a Component using the Component's addHierarchyListener method. When the hierarchy to which the Component belongs changes the hierarchyChanged method in the listener object is invoked and the HierarchyEvent is passed to it.

Hierarchy events are provided for notification purposes ONLY; The AWT will automatically handle changes to the hierarchy internally so that GUI layout displayability and visibility work properly regardless of whether a program registers a HierarchyListener or not. @author David Mendenhall @version 1.5 026 12/0203/0001 @see HierarchyEvent @since 1.3


Class InputEvent

The root event class for all component-level input events. Input events are delivered to listeners before they are processed normally by the source where they originated. This allows listeners and component subclasses to "consume" the event so that the source will not process them in their default manner. For example consuming mousePressed events on a Button component will prevent the Button from being activated. @author Carl Quinn @version 1.22 0227 12/0203/0001 @see KeyEvent @see KeyAdapter @see MouseEvent @see MouseAdapter @see MouseMotionAdapter @since 1.1
Class InputEvent, int ALT_MASK

The alt key modifier constant. It is recommended that ALT_DOWN_MASK to be used instead.
Class InputEvent, int BUTTON1_MASK

The mouse button1 modifier constant. It is recommended that BUTTON1_DOWN_MASK to be used instead.
Class InputEvent, int BUTTON2_MASK

The mouse button2 modifier constant. It is recommended that BUTTON2_DOWN_MASK to be used instead.
Class InputEvent, int BUTTON3_MASK

The mouse button3 modifier constant. It is recommended that BUTTON3_DOWN_MASK to be used instead.
Class InputEvent, int CTRL_MASK

The control key modifier constant. It is recommended that CTRL_DOWN_MASK to be used instead.
Class InputEvent, int META_MASK

The meta key modifier constant. It is recommended that META_DOWN_MASK to be used instead.
Class InputEvent, int SHIFT_MASK

The shift key modifier constant. It is recommended that SHIFT_DOWN_MASK to be used instead.

Class InputMethodEvent

Input method events contain information about text that is being composed using an input method. Whenever the text changes the input method sends an event. If the text component that's currently using the input method is an active client the event is dispatched to that component. Otherwise it is dispatched to a separate composition window.

The text included with the input method event consists of two parts: committed text and composed text. Either part may be empty. The two parts together replace any uncommitted composed text sent in previous events or the currently selected committed text. Committed text should be integrated into the text component's persistent data it will not be sent again. Composed text may be sent repeatedly with changes to reflect the user's editing operations. Committed text always precedes composed text. @author JavaSoft Asia/Pacific @version 1.16 0219 12/0203/0001 @since 1.2

Class InputMethodEvent, constructor InputMethodEvent(Component, int, AttributedCharacterIterator, int, TextHitInfo, TextHitInfo)

Constructs an InputMethodEvent with the specified source component type text caret and visiblePosition.

The offsets of caret and visiblePosition are relative to the current composed text; that is the composed text within text if this is an INPUT_METHOD_TEXT_CHANGED event the composed text within the text of the preceding INPUT_METHOD_TEXT_CHANGED event otherwise. The time stamp for this event is initialized by invoking java.awt.EventQueue#getMostRecentEventTime() @param source Thethe object where the event originated. @param id Thethe event type. @param text Thethe combined committed and composed text committed text first.; Mustmust be null when the event type is CARET_POSITION_CHANGED; may be null for INPUT_METHOD_TEXT_CHANGED if there's no committed or composed text. @param committedCharacterCount Thethe number of committed characters in the text. @param caret the caret (a.k.a. insertion point).; Nullnull if there's no caret within current composed text. @param visiblePosition Thethe position that's most important to be visible.; Nullnull if there's no recommendation for a visible position within current composed text. @exception IllegalArgumentException if id is not in the range INPUT_METHOD_FIRST..INPUT_METHOD_LAST; or if id is CARET_POSITION_CHANGED and text is not null; or if committedCharacterCount is not in the range 0..(text.getEndIndex() - text.getBeginIndex())

Class InputMethodEvent, constructor InputMethodEvent(Component, int, TextHitInfo, TextHitInfo)

Constructs an InputMethodEvent with the specified source component type caret and visiblePosition. The text is set to null committedCharacterCount to 0.

The offsets of caret and visiblePosition are relative to the current composed text; that is the composed text within the text of the preceding INPUT_METHOD_TEXT_CHANGED event if the event being constructed as a CARET_POSITION_CHANGED event. For an INPUT_METHOD_TEXT_CHANGED event without text caret and visiblePosition must be null. The time stamp for this event is initialized by invoking java.awt.EventQueue#getMostRecentEventTime() @param source Thethe object where the event originated. @param id Thethe event type. @param caret the caret (a.k.a. insertion point).; Nullnull if there's no caret within current composed text. @param visiblePosition Thethe position that's most important to be visible.; Nullnull if there's no recommendation for a visible position within current composed text @exception IllegalArgumentException if id is not in the range INPUT_METHOD_FIRST..INPUT_METHOD_LAST


Class InputMethodListener

The listener interface for receiving input method events. A text editing component has to install an input method event listener in order to work with input methods.

The text editing component also has to provide an instance of InputMethodRequests. @author JavaSoft Asia/Pacific @version 1.8 029 12/0203/0001 @see InputMethodEvent @see java.awt.im.InputMethodRequests @since 1.2


Class InvocationEvent

An event which executes the run() method on a Runnable when dispatched by the AWT event dispatcher thread. This class can be used as a reference implementation of ActiveEvent rather than declaring a new class and defining dispatch().

Instances of this class are placed on the EventQueue by calls to invokeLater and invokeAndWait. Client code can use this fact to write replacement functions for invokeLater and invokeAndWait without writing special-case code in any AWTEventListener objects. @author Fred Ecks @author David Mendenhall @version 1.9 0213 12/0203/0001 @see java.awt.ActiveEvent @see java.awt.EventQueue#invokeLater @see java.awt.EventQueue#invokeAndWait @see AWTEventListener @since 1.2

Class InvocationEvent, constructor InvocationEvent(Object, Runnable)

Constructs an InvocationEvent with the specified source which will execute the runnable's run() method when dispatched. @param source the Object that originated the event @param runnable the Runnable whose run() method will be executed
Class InvocationEvent, constructor InvocationEvent(Object, Runnable, Object, boolean)

Constructs an InvocationEvent with the specified source which will execute the runnable's run() method when dispatched. If notifier is non-null notifyAll() will be called on it immediately after run() returns. @param source the Object that originated the event @param runnable the Runnable whose run() method will be executed @param notifier the Object whose notifyAll() method will be called after Runnable.run() has returned @param catchExceptions specifies whether dispatch() should catch Exception when executing the Runnable's run() method or should instead propagate those Exceptions to the EventDispatchThread's dispatch loop
Class InvocationEvent, constructor InvocationEvent(Object, int, Runnable, Object, boolean)

Constructs an InvocationEvent with the specified source and ID which will execute the runnable's run() method when dispatched. If notifier is non-null notifyAll() will be called on it immediately after run() returns.

Note that passing in an invalid id results in unspecified behavior. @param source the Object that originated the event @param id the ID for the Eventevent @param runnable the Runnable whose run() method will be executed @param notifier the Object whose notifyAll() method will be called after Runnable.run() has returned @param catchExceptions specifies whether dispatch() should catch Exception when executing the Runnable's run() method or should instead propagate those Exceptions to the EventDispatchThread's dispatch loop


Class ItemEvent

A semantic event which indicates that an item was selected or deselected. This high-level event is generated by an ItemSelectable object (such as a List) when an item is selected or de-selecteddeselected by the user. The event is passed to every ItemListener object which registered to receive such events using the component's addItemListener method.

The object that implements the ItemListener interface gets this ItemEvent when the event occurs. The listener is spared the details of processing individual mouse movements and mouse clicks and can instead process a "meaningful" (semantic) event like "item selected" or "item deselected". @version 1.21 0224 12/0203/0001 @author Carl Quinn @see java.awt.ItemSelectable @see ItemListener @see Tutorial: Writing an Item Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class ItemEvent, constructor ItemEvent(ItemSelectable, int, Object, int)

Constructs an ItemEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the ItemSelectable object that originated the event @param id an integer that identifies the event type @param item an object -- the item affected by the event @param stateChange an integer that indicates whether the item was selected or deselected

Class ItemEvent, int DESELECTED

This state-change-value indicates that a selected item was un-selecteddeselected.

Class ItemListener

The listener interface for receiving item events. The class that is interested in processing an item event implements this interface. The object created with that class is then registered with a component using the component's addItemListener method. When an item-selection event occurs the listener object's itemStateChanged method is invoked. @author Amy Fowler @version 1.13 0215 12/0203/0001 @see ItemSelectable @see ItemEvent @see Tutorial: Writing an Item Listener @see Reference: The Java Class Libraries (update file) @since 1.1
Class ItemListener, void itemStateChanged(ItemEvent)

Invoked when an item has been selected or deselected by the user. The code written for this method performs the operations that need to occur when an item is selected (or deselected).

Class KeyAdapter

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

Extend this class to create a KeyEvent listener and override the methods for the events of interest. (If you implement the KeyListener 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 component using the component's addKeyListener method. When a key is pressed released or typed (pressed and released) the relevant method in the listener object is invoked and the KeyEvent is passed to it. @author Carl Quinn @version 1.13 0214 12/0203/0001 @see KeyEvent @see KeyListener @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @since 1.1


Class KeyEvent

An event which indicates that a keystroke occurred in a component.

This low-level event is generated by a component object (such as a text field) when a key is pressed released or typed. The event is passed to every KeyListener or KeyAdapter object which registered to receive such events using the component's addKeyListener method. (KeyAdapter objects implement the KeyListener interface.) Each such listener object gets this KeyEvent when the event occurs.

"Key typed" events are higher-level and generally do not depend on the platform or keyboard layout. They are generated when a Unicode character is entered and are the preferred way to find out about character input. In the simplest case a key typed event is produced by a single key press (e.g. 'a'). Often however characters are produced by series of key presses (e.g. 'shift' + 'a') and the mapping from key pressed events to key typed events may be many-to-one or many-to-many. Key releases are not usually necessary to generate a key typed event but there are some cases where the key typed event is not generated until a key is released (e.g. entering ASCII sequences via the Alt-Numpad method in Windows). No key typed events are generated for keys that don't generate Unicode characters (e.g. action keys modifier keys etc.). The getKeyChar method always returns a valid Unicode character or CHAR_UNDEFINED. For key pressed and key released events the getKeyCode method returns the event's keyCode. For key typed events the getKeyCode method always returns VK_UNDEFINED.

"Key pressed" and "key released" events are lower-level and depend on the platform and keyboard layout. They are generated whenever a key is pressed or released and are the only way to find out about keys that don't generate character input (e.g. action keys modifier keys etc.). The key being pressed or released is indicated by the getKeyCode method which returns a virtual key code.

Virtual key codes are used to report which keyboard key has been pressed rather than a character generated by the combination of one or more keystrokes (likesuch as "A" which comes from shift and "a").

For example pressing the Shift key will cause a KEY_PRESSED event with a VK_SHIFT keyCode while pressing the 'a' key will result in a VK_A keyCode. After the 'a' key is released a KEY_RELEASED event will be fired with VK_A. Separately a KEY_TYPED event with a keyChar value of 'A' is generated.

Notes:

WARNING: Aside from those keys that are defined by the Java language (VK_ENTER VK_BACK_SPACE and VK_TAB) do not rely on the values of the VK_ constants. Sun reserves the right to change these values as needed to accomodate a wider range of keyboards in the future. @author Carl Quinn @author Amy Fowler @author Norbert Lindenberg @version 1.4458 0412/0603/0001 @see KeyAdapter @see KeyListener @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class KeyEvent, constructor KeyEvent(Component, int, long, int, int, char)

Constructs a KeyEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the Component that originated the event @param id an integer identifying the type of event @param when a long integer that specifysspecifies the time the event occurred @param modifiers the modifier keys down during event (shift ctrl alt meta) Either extended _DOWN_MASK or old _MASK modifiers should be used but both models should not be mixed in one event. Use of the extended modifiers is preferred. @param keyCode the integer code for an actual key or VK_UNDEFINED (for a key-typed event) @param keyChar the Unicode character generated by this event or CHAR_UNDEFINED (for key-pressed and key-released events which do not map to a valid Unicode character) @exception IllegalArgumentException if id is KEY_TYPED and keyChar is CHAR_UNDEFINED; or if id is KEY_TYPED and keyCode is not VK_UNDEFINED

Class KeyEvent, char getKeyChar()

Returns the character associated with the key in this event. For example the key-typed event for shift + "a" returns the value for "A". @return the Unicode character defined for this key event. If no valid Unicode character exists for this key event keyChar is CHAR_UNDEFINED.
Class KeyEvent, int getKeyCode()

Returns the integer key-codekeyCode associated with the key in this event. @return the integer code for an actual key on the keyboard. (For KEY_TYPED events the keyCode is VK_UNDEFINED.)
Class KeyEvent, String getKeyText(int)

Returns a String describing the keyCode such as "HOME" "F1" or "A". These strings can be localized by changing the awt.properties file. @return a string containing a text description for a physical key identified by its keyCode
Class KeyEvent, boolean isActionKey()

Returns whether or not the key in this event is an "action" key. as defined inTypically an action Event.javakey does not fire a unicode character and is not a modifier key. @return boolean value true if the key is an "action" key @seefalse Eventotherwise
Class KeyEvent, String paramString()

Returns a parameter string identifying this event. This method is useful for event- logging and for debugging. @return a string identifying the event and its attributes
Class KeyEvent, void setModifiers(int)

Set the modifiers to indicate additional keys that were held down (e.g. shift ctrl alt meta) defined as part of InputEvent.

NOTE: use of this method is not recommended because many AWT implementations do not recognize modifier changes. This is especially true for KEY_TYPED events where the shift modifier is changed. @param modifiers an integer combination of the modifier constants. @see InputEvent @deprecated as of JDK1.1.4

Class KeyEvent, void setSource(Object)

SetRetargets thean event to a new source. This method is typically used to retarget an event to a lightweight child Component of thisthe original KeyEventheavyweight source. Dispatching this event subsequent to this operation will send this

This method is intended to be used only by event totargeting the newsubsystems such Objectas client-defined KeyboardFocusManagers. It is not for general client use. @param newSource the KeyEvent's new source.Object to which the event should be dispatched

Class KeyEvent, int VK_KP_DOWN

Constant for the key padnumeric arrowkeypad down functionarrow key. @see #VK_DOWN @since 1.2
Class KeyEvent, int VK_KP_LEFT

Constant for the key padnumeric arrowkeypad left functionarrow key. @see #VK_LEFT @since 1.2
Class KeyEvent, int VK_KP_RIGHT

Constant for the key padnumeric arrowkeypad right functionarrow key. @see #VK_RIGHT @since 1.2
Class KeyEvent, int VK_KP_UP

Constant for the key padnumeric arrowkeypad up functionarrow key. @see #VK_UP @since 1.2
Class KeyEvent, int VK_UNDEFINED

This value is used to indicate that the keyCode is unknown. KEY_TYPED events do not have a keyCode value. This; this value is used instead.

Class KeyListener

The listener interface for receiving keyboard events (keystrokes). The class that is interested in processing a keyboard event either implements this interface (and all the methods it contains) or extends the abstract KeyAdapter class (overriding only the methods of interest).

The listener object created from that class is then registered with a component using the component's addKeyListener method. A keyboard event is generated when a key is pressed released or typed (pressedn and released). The relevant method in the listener object is then invoked and the KeyEvent is passed to it. @author Carl Quinn @version 1.13 0215 12/0203/0001 @see KeyAdapter @see KeyEvent @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class KeyListener, void keyPressed(KeyEvent)

Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.
Class KeyListener, void keyReleased(KeyEvent)

Invoked when a key has been released. See the class description for KeyEvent for a definition of a key released event.
Class KeyListener, void keyTyped(KeyEvent)

Invoked when a key has been typed. This event occurs when aSee the class description for keyKeyEvent press is followed byfor a definition of a key releasetyped event.

Class MouseEvent

/** An event which indicates that a mouse action occurred in a component. A mouse action is considered to occur in a particular component if and only if the mouse cursor is over the unobscured part of the component's bounds when the action happens. Component bounds can be obscurred by the visible component's children or by a menu or by a top-level window. This event is used both for mouse events (click enter exit) and mouse motion events (moves and drags).

This low-level event is generated by a component object for:

A MouseEvent object is passed to every MouseListener or MouseAdapter object which is registered to receive the "interesting" mouse events using the component's addMouseListener method. (MouseAdapter objects implement the MouseListener interface.) Each such listener object gets a MouseEvent containing the mouse event.

A MouseEvent object is also passed to every MouseMotionListener or MouseMotionAdapter object which is registered to receive mouse motion events using the component's addMouseMotionListener method. (MouseMotionAdapter objects implement the MouseMotionListener interface.) Each such listener object gets a MouseEvent containing the mouse motion event.

When a mouse button is clicked events are generated and sent to the registered MouseListenersMouseListeners. withThe thestate of modal keys can be retrieved using InputEvent#getModifiers and InputEvent#getModifiersEx The button mask setreturned by InputEvent#getModifiers reflects only the button that changed state not the current state of all buttons. (Note: Due to overlap in the values of ALT_MASK/BUTTON2_MASK and META_MASK/BUTTON3_MASK this is not always true for mouse events involving modifier fieldkeys). To get the state of all buttons and modifier keys use InputEvent#getModifiersEx The button which has changed state is returned by MouseEvent#getButton

For example if the first mouse button is pressed events are sent in the following order:

 id  modifiers  button  MOUSE_PRESSED: BUTTON1_MASK BUTTON1 MOUSE_RELEASED: BUTTON1_MASK BUTTON1 MOUSE_CLICKED: BUTTON1_MASK BUTTON1 
When multiple mouse buttons are pressed each press release and click results in a separate event. The button mask in the modifier field reflects only the button that changed state not the current state of all buttons.

For example if the user presses button 1 followed by button 2 and then releases them in the same order the following sequence of events is generated:

 id  modifiers  button  MOUSE_PRESSED: BUTTON1_MASK BUTTON1 MOUSE_PRESSED: BUTTON2_MASK BUTTON2 MOUSE_RELEASED: BUTTON1_MASK BUTTON1 MOUSE_CLICKED: BUTTON1_MASK BUTTON1 MOUSE_RELEASED: BUTTON2_MASK BUTTON2 MOUSE_CLICKED: BUTTON2_MASK BUTTON2 
If button2button 2 is released first the MOUSE_RELEASED/MOUSE_CLICKED pair for BUTTON2_MASK arrives first followed by the pair for BUTTON1_MASK.

MOUSE_DRAGGED events are delivered to the Component in which the mouse button was pressed until the mouse button is released (regardless of whether the mouse position is within the bounds of the Component). Due to platform-dependent Drag&Drop implementations MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation. In a multi-screen environment mouse drag events are delivered to the Component even if the mouse position is outside the bounds of the GraphicsConfiguration associated with that Component. However the reported position for mouse drag events in this case may differ from the actual mouse position:

  • In a multi-screen environment without a virtual device:
    The reported coordinates for mouse drag events are clipped to fit within the bounds of the GraphicsConfiguration associated with the Component.
  • In a multi-screen environment with a virtual device:
    The reported coordinates for mouse drag events are clipped to fit within the bounds of the virtual device associated with the Component.
@author Carl Quinn @version 1.26 0241 12/0203/0001 @see MouseAdapter @see MouseListener @see MouseMotionAdapter @see MouseMotionListener @see MouseWheelListener @see Tutorial: Writing a Mouse Listener @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @since 1.1
Class MouseEvent, constructor MouseEvent(Component, int, long, int, int, int, int, boolean)

Constructs a MouseEvent object with the specified source component type modifiers coordinates and click count.

Note that passing in an invalid id results in unspecified behavior. @param source the Component that originated the event @param id the integer that identifies the event @param when a long int that gives the time the event occurred @param modifiers the modifier keys down during event (e.g. shift ctrl alt meta) Either extended _DOWN_MASK or old _MASK modifiers should be used but both models should not be mixed in one event. Use of the extended modifiers is preferred. @param x the horizontal x coordinate for the mouse location @param y the vertical y coordinate for the mouse location @param clickCount the number of mouse clicks associated with event @param popupTrigger a boolean true if this event is a trigger for a popup- menu

Class MouseEvent, int getClickCount()

ReturnReturns the number of mouse clicks associated with this event. @return integer value for the number of clicks
Class MouseEvent, Point getPoint()

Returns the x y position of the event relative to the source component. @return a Point object containing the x and y coordinates relative to the source component
Class MouseEvent, boolean isPopupTrigger()

Returns whether or not this mouse event is the popup- menu trigger event for the platform.

Note: Popup menus are triggered differently on different systems. Therefore isPopupTrigger should be checked in both mousePressed and mouseReleased for proper cross-platform functionality. @return boolean true if this event is the popup- menu trigger for this platform

Class MouseEvent, void translatePoint(int, int)

Translates the event's coordinates to a new position by adding specified x (horizontal) and y (veritcalvertical) offsets. @param x the horizontal x value to add to the current x coordinate position @param y the vertical y value to add to the current y coordinate position
Class MouseEvent, int MOUSE_CLICKED

The "mouse clicked" event. This MouseEvent occurs when a mouse button is pressed and released.
Class MouseEvent, int MOUSE_DRAGGED

The "mouse dragged" event. This MouseMotionEvent occurs when the mouse position changes while thea "drag"mouse modifierbutton is active (for example the shift key)pressed.
Class MouseEvent, int MOUSE_ENTERED

The "mouse entered" event. This MouseEvent occurs when the mouse cursor enters athe unobscured part of component's areageometry.
Class MouseEvent, int MOUSE_EXITED

The "mouse exited" event. This MouseEvent occurs when the mouse cursor leavesexits athe unobscured part of component's areageometry.
Class MouseEvent, int MOUSE_MOVED

The "mouse moved" event. This MouseMotionEvent occurs when the mouse position changes.
Class MouseEvent, int MOUSE_PRESSED

The "mouse pressed" event. This MouseEvent occurs when a mouse button is pushed down.
Class MouseEvent, int MOUSE_RELEASED

The "mouse released" event. This MouseEvent occurs when a mouse button is let up.

Class MouseListener

The listener interface for receiving "interesting" mouse events (press release click enter and exit) on a component. (To track mouse moves and mouse drags use the MouseMotionListener.)

The class that is interested in processing a mouse event either implements this interface (and all the methods it contains) or extends the abstract MouseAdapter class (overriding only the methods of interest).

The listener object created from that class is then registered with a component using the component's addMouseListener method. A mouse event is generated when the mouse is pressed released clicked (pressed and released). A mouse event is also generated when the mouse cursor enters or leaves a component. When a mouse event occurs the relevant method in the listener object is invoked and the MouseEvent is passed to it. @author Carl Quinn @version 1.13 0215 12/0203/0001 @see MouseAdapter @see MouseEvent @see Tutorial: Writing a Mouse Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class MouseListener, void mouseClicked(MouseEvent)

Invoked when the mouse button has been clicked (pressed and released) on a component.

Class MouseMotionAdapter

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

Mouse motion events occur when a mouse is moved or dragged. (Many such events will be generated in a normal program. To track clicks and other mouse events use the MouseAdapter.)

Extend this class to create a MouseMotionEvent listener and override the methods for the events of interest. (If you implement the MouseMotionListener 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 component using the component's addMouseMotionListener method. When the mouse is moved or dragged the relevant method in the listener object is invoked and the MouseEvent is passed to it. @author Amy Fowler @version 1.11 0212 12/0203/0001 @see MouseEvent @see MouseMotionListener @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @since 1.1


Class MouseMotionListener

The listener interface for receiving mouse motion events on a component. (For clicks and other mouse events use the MouseListener.)

The class that is interested in processing a mouse motion event either implements this interface (and all the methods it contains) or extends the abstract MouseMotionAdapter class (overriding only the methods of interest).

The listener object created from that class is then registered with a component using the component's addMouseMotionListener method. A mouse motion event is generated when the mouse is moved or dragged. (Many such events will be generated). When a mouse motion event occurs the relevant method in the listener object is invoked and the MouseEvent is passed to it. @author Amy Fowler @version 1.9 0212 12/0203/0001 @see MouseMotionAdapter @see MouseEvent @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class MouseMotionListener, void mouseDragged(MouseEvent)

Invoked when a mouse button is pressed on a component and then dragged. MouseMOUSE_DRAGGED drag events will continue to be delivered to the component where the firstdrag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Class MouseMotionListener, void mouseMoved(MouseEvent)

Invoked when the mouse button has been moved on a component (with no buttons no down).

Class PaintEvent

The component-level paint event. This event is a special type which is used to ensure that paint/update method calls are serialized along with the other events delivered from the event queue. This event is not designed to be used with the Event Listener model; programs should continue to override paint/update methods in order render themselves properly. @author Amy Fowler @version 1.14 0216 12/0203/0001 @since 1.1
Class PaintEvent, constructor PaintEvent(Component, int, Rectangle)

Constructs a PaintEvent object with the specified source component and type.

Note that passing in an invalid id results in unspecified behavior. @param source the object where the event originated @param id the event type @param updateRect the rectangle area which needs to be repainted


Class TextEvent

A semantic event which indicates that an object's text changed. This high-level event is generated by an object (such as a TextComponent) when its text changes. The event is passed to every TextListener object which registered to receive such events using the component's addTextListener method.

The object that implements the TextListener interface gets this TextEvent when the event occurs. The listener is spared the details of processing individual mouse movements and key strokes Instead it can process a "meaningful" (semantic) event like "text changed". @author Georges Saab @version 1.11 0213 12/0203/0001 @see java.awt.TextComponent @see TextListener @see Tutorial: Writing a Text Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class TextEvent, constructor TextEvent(Object, int)

Constructs a TextEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the (TextComponent) object that originated the event @param id an integer that identifies the event type


Class TextListener

The listener interface for receiving text events. The class that is interested in processing a text event implements this interface. The object created with that class is then registered with a component using the component's addTextListener method. When the component's text changes the listener object's textValueChanged method is invoked. @author Georges Saab @version 1.9 0210 12/0203/0001 @see TextEvent @see Tutorial: Writing a Text Listener @see Reference: The Java Class Libraries (update file) @since 1.1

Class WindowAdapter

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. @see WindowEvent @see WindowListener @see Tutorial: Writing a Window Listener @see Reference: The Java Class Libraries (update file) @author Carl Quinn @author Amy Fowler @author David Mendenhall @version 1.15 0218 12/0203/0001 @since 1.1


Class WindowEvent

A low-level event whichthat indicates that a window has changed its status. This low-level event is generated by a Window object when it is opened closed aboutactivated deactivated to close activatediconified or deiconified or deactivatedwhen iconifiedfocus is transfered into or deconifiedout of the Window.

The event is passed to every WindowListener or WindowAdapter object which registered to receive such events using the window's addWindowListener method. (WindowAdapter objects implement the WindowListener interface.) Each such listener object gets this WindowEvent when the event occurs. @author Carl Quinn @author Amy Fowler @version 1.21 0227 12/0203/0001 @see WindowAdapter @see WindowListener @see Tutorial: Writing a Window Listener @see Reference: The Java Class Libraries (update file) @since 1JDK1.1

Class WindowEvent, constructor WindowEvent(Window, int)

Constructs a WindowEvent object.

Note that passing in an invalid id results in unspecified behavior. @param source the Window object that originated the event @param id an integer indicating the type of event

Class WindowEvent, int WINDOW_ACTIVATED

The window -activated event type. This event is delivered when the windowWindow becomes the user'sactive Window. Only a Frame or a Dialog can be the active windowWindow. which meansThe native thatwindowing system may denote the windowactive Window (or one ofits children itswith special decorations such as a subcomponents)highlighted willtitle receivebar. The active Window is always either the focused Window or the first Frame or Dialog that is an owner of the keyboard eventsfocused Window.
Class WindowEvent, int WINDOW_DEACTIVATED

The window -deactivated event type. This event is delivered when athe windowWindow is no longer the user's active windowWindow. which means keyboard events will no longerOnly a Frame or a Dialog can be deliveredthe active Window. toThe native windowing system may denote the windowactive Window or its subcomponentschildren with special decorations such as a highlighted title bar. The active Window is always either the focused Window or the first Frame or Dialog that is an owner of the focused Window.

Class WindowListener

The listener interface for receiving window events. The class that is interested in processing a window event either implements this interface (and all the methods it contains) or extends the abstract WindowAdapter class (overriding only the methods of interest). The listener object created from that class is then registered 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. @author Carl Quinn @version 1.16 0218 12/0203/0001 @see WindowAdapter @see WindowEvent @see Tutorial: Writing a Window Listener @see Reference: The Java Class Libraries (update file) @since 1.1
Class WindowListener, void windowActivated(WindowEvent)

Invoked when the windowWindow is set to be the user'sactive Window. Only a Frame or a Dialog can be the active windowWindow. The native windowing system which meansmay denote the windowactive Window (or one ofits children itswith special decorations such as a highlighted subcomponents)title willbar. The active Window is always either the focused Window or receivethe first Frame or Dialog that is an owner of the keyboard eventsfocused Window.
Class WindowListener, void windowDeactivated(WindowEvent)

Invoked when a windowWindow is no longer the user's active window whichWindow. means that keyboard events will no longerOnly a Frame or a Dialog can be deliveredthe active Window. The native towindowing system may denote the windowactive Window or its subcomponentschildren with special decorations such as a highlighted title bar. The active Window is always either the focused Window or the first Frame or Dialog that is an owner of the focused Window.