|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejava.awt.event
as colored differences. Deletions are shownlike 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.
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'seventDispatcheded
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
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 everyClass ActionEvent, constructor ActionEvent(Object, int, String)ActionListener
object that registered to receive such events using the component'saddActionListener
method.The object that implements the
ActionListener
interface gets thisActionEvent
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
Constructs anClass ActionEvent, constructor ActionEvent(Object, int, String, int)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
Constructs anClass ActionEvent, int getModifiers()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
Returns the modifier keys held down during this action event. @return theintegerbitwise-orsumof the modifier constants
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'saddActionListener
method. When the action event occurs that object'sactionPerformed
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
The adjustment event emitted by Adjustable objects. @see java.awt.Adjustable @see AdjustmentListener @author Amy Fowler @version 1.Class AdjustmentEvent, constructor AdjustmentEvent(Adjustable, int, int, int)21 0224 12/0203/0001 @since 1.1
ConstructsClass AdjustmentEvent, Adjustable getAdjustable()aanAdjustmentEvent
object with the specifiedAdjustable
source event type adjustment type and value.typeNote
andthatvaluepassing in an invalidid
results in unspecified behavior. @param source theAdjustable
object where the event originated @param id the event type @param type the adjustment type @param value the current value of the adjustment
Returns theClass AdjustmentEvent, int getAdjustmentType()Adjustable
object where this event originated. @return theAdjustable
object where this event originated
Returns the type of adjustment which caused the value changed event. It will have one of the following values:Class AdjustmentEvent, int getValue()@
- {
seelink #UNIT_INCREMENT}{@ seelink #UNIT_DECREMENT}{@ seelink #BLOCK_INCREMENT}{@ seelink #BLOCK_DECREMENT}{@ seelink #TRACK} @return one of the adjustment values listed above
Returns the current value in the adjustment event. @return the current value in the adjustment event
The listener interface for receiving adjustment events. @author Amy Fowler @version 1.11 0212 12/0203/0001 @since 1.1
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 theComponentListener
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 theComponentEvent
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
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).Class ComponentEvent, constructor ComponentEvent(Component, int)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
orComponentAdapter
object which registered to receive such events using the component'saddComponentListener
method. (ComponentAdapter
objects implement theComponentListener
interface.) Each such listener object gets thisComponentEvent
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
Constructs aClass ComponentEvent, Component getComponent()ComponentEvent
object.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
that originated the event @param id an integer indicating the type of eventobject
Returns the originator of the event. @return theComponent
object that originated the event ornull
if the object is not aComponent
.
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 abstractComponentAdapter
class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component'saddComponentListener
method. When the component's size location or visibility changes the relevant method in the listener object is invoked and theComponentEvent
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
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 theContainerListener
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 theContainerEvent
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
A low-level event which indicates that a container's contents changed because a component was added or removed.Class ContainerEvent, constructor ContainerEvent(Component, int, Component)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
orContainerAdapter
object which registered to receive such events using the component'saddContainerListener
method. (ContainerAdapter
objects implement theContainerListener
interface.) Each such listener object gets thisContainerEvent
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
Constructs aContainerEvent
object.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
object (container) that originated the event @param id an integer indicating the type of event @param child the component that was added or removed
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 abstractContainerAdapter
class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component'saddContainerListener
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 theContainerEvent
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
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 theFocusListener
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 theFocusEvent
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
A low-level event which indicates that aClass FocusEvent, constructor FocusEvent(Component, int)componentComponent has gained or lost thekeyboardinput focus. This low-level event is generated by acomponentComponent (such as atext fieldTextField). The event is passed to everyFocusListener
orFocusAdapter
object which registered to receive such events using thecomponentComponent'saddFocusListener
method. (FocusAdapter
objects implement theFocusListener
interface.) Each such listener object gets thisFocusEvent
when the event occurs.There are two levels of focus
changeevents: permanent and temporary. Permanent focus change events occur when focus is directly moved from onecomponentComponent to another such as throughcallsa call to requestFocus() or as the user uses theTabTAB key to traversecomponentsComponents. Temporary focus change events occur when focus is temporarilygained orlost for acomponentComponent as the indirect result of another operation such aswindowWindow deactivation or ascrollbarScrollbar drag. In this case the original focus state will automatically be restored once that operation is finished or for the case ofwindowWindow deactivation when thewindowWindow is reactivated. Both permanent and temporary focus events are delivered using the FOCUS_GAINED and FOCUS_LOST event ids; thelevelslevel 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
Constructs aClass FocusEvent, constructor FocusEvent(Component, int, boolean)FocusEvent
object and identifies it as a permanent change in focus.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
that originated the event @param id an integer indicating the type of event
Constructs aClass FocusEvent, boolean isTemporary()FocusEvent
object and identifies whether or not the change is temporary.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
that originated the event @param id an integer indicating the type of event @param temporarya booleantrue
if the focus change is temporary;false
otherwise
Identifies the focus change event as temporary or permanent. @returnClass FocusEvent, int FOCUS_GAINEDa boolean valuetrue
if the focus change is temporary;false
otherwise
This event indicates that theClass FocusEvent, int FOCUS_LOSTcomponent gained the keyboardComponent is now the focus owner.
This event indicates that thecomponent lostComponent istheno longerkeyboardthe focus owner.
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 abstractFocusAdapter
class (overriding only the methods of interest). The listener object created from that class is then registered with a component using the component'saddFocusListener
method. When the component gains or loses the keyboard focus the relevant method in the listener object is invoked and theFocusEvent
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
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 theHierarchyEvent
is passed to it. @author David Mendenhall @version 1.4 025 12/0203/0001 @see HierarchyBoundsListener @see HierarchyEvent @since 1.3
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 abstractHierarchyBoundsAdapter
class (overriding only the method of interest). The listener object created from that class is then registered with a Component using the Component'saddHierarchyBoundsListener
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 theHierarchyEvent
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
An event which indicates a change to theClass HierarchyEvent, constructor HierarchyEvent(Component, int, Component, Container)Component
hierarchy to which aComponent
belongs.
- Hierarchy Change Events (HierarchyListener)
- addition of an ancestor
- removal of an ancestor
- hierarchy made displayable
- hierarchy made undisplayable
- hierarchy shown on the screen (both visible and displayable)
- hierarchy hidden on the screen (either invisible or undisplayable)
- Ancestor Reshape Events (HierarchyBoundsListener)
- an ancestor was resized
- an ancestor was moved
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
orhide
method is called. ANCESTOR_MOVED and ANCESTOR_RESIZED events are dispatched to everyHierarchyBoundsListener
orHierarchyBoundsAdapter
object which registered to receive such events using the Component'saddHierarchyBoundsListener
method. (HierarchyBoundsAdapter
objects implement theHierarchyBoundsListener
interface.) HIERARCHY_CHANGED events are dispatched to everyHierarchyListener
object which registered to receive such events using the Component'saddHierarchyListener
method. Each such listener object gets thisHierarchyEvent
when the event occurs. @author David Mendenhall @version 1.590212/0203/0001 @see HierarchyListener @see HierarchyBoundsAdapter @see HierarchyBoundsListener @since 1.3
Constructs anClass HierarchyEvent, constructor HierarchyEvent(Component, int, Component, Container, long)HierarchyEvent
object to identify a change in theComponent
hierarchy.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
object that originated the event @param id an integer indicating the type of event @param changed theComponent
at the top of the hierarchy which was changed @param changedParent the parent ofchanged
. This; this may be the parent before or after the change depending on the type of change.
Constructs anClass HierarchyEvent, Component getComponent()HierarchyEvent
object to identify a change in theComponent
hierarchy.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
object that originated the event @param id an integer indicating the type of event @param changed theComponent
at the top of the hierarchy which was changed @param changedParent the parent ofchanged
. 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) ofHIERARCHY_CHANGED
events represented in this event object
Returns the originator of the event. @return theClass HierarchyEvent, int ANCESTOR_MOVEDComponent
object that originated the event ornull
if the object is not aComponent
.
Class HierarchyEvent, int ANCESTOR_RESIZEDAnThe event id indicating an ancestor-Container was moved.
Class HierarchyEvent, int DISPLAYABILITY_CHANGEDAnThe event id indicating an ancestor-Container was resized.
Class HierarchyEvent, int HIERARCHY_CHANGEDTheIndicates that theHIERARCHY_CHANGED
event was generated due to a change in the displayability of the hierarchychanged. To discern the current displayability of the hierarchy callComponent.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 PARENT_CHANGEDAThe event id indicating that modification was made to the entire hierarchy tree.
Class HierarchyEvent, int SHOWING_CHANGEDThe hierarchy changedIndicates that thethroughHIERARCHY_CHANGED
event was generated by areparentreparenting operation.
TheIndicates that theHIERARCHY_CHANGED
event was generated due to a change in the showing state of the hierarchychanged. To discern the current showing state of the hierarchy callComponent.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 toComponent.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()()
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'saddHierarchyListener
method. When the hierarchy to which the Component belongs changes thehierarchyChanged
method in the listener object is invoked and theHierarchyEvent
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
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.Class InputEvent, int ALT_MASK22 0227 12/0203/0001 @see KeyEvent @see KeyAdapter @see MouseEvent @see MouseAdapter @see MouseMotionAdapter @since 1.1
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.
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.Class InputMethodEvent, constructor InputMethodEvent(Component, int, AttributedCharacterIterator, int, TextHitInfo, TextHitInfo)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
Constructs anClass InputMethodEvent, constructor InputMethodEvent(Component, int, TextHitInfo, TextHitInfo)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 anINPUT_METHOD_TEXT_CHANGED
event the composed text within thetext
of the precedingINPUT_METHOD_TEXT_CHANGED
event otherwise. The time stamp for this event is initialized by invoking java.awt.EventQueue#getMostRecentEventTime() @param sourceThethe object where the event originated.@param idThethe event type.@param textThethe combined committed and composed text committed text first.;Mustmust benull
when the event type isCARET_POSITION_CHANGED
; may benull
forINPUT_METHOD_TEXT_CHANGED
if there's no committed or composed text.@param committedCharacterCountThethe 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 visiblePositionThethe position that's most important to be visible.;Nullnull
if there's no recommendation for a visible position within current composed text.@exception IllegalArgumentException ifid
is not in the rangeINPUT_METHOD_FIRST
..INPUT_METHOD_LAST
; or if id isCARET_POSITION_CHANGED
andtext
is notnull
; or ifcommittedCharacterCount
is not in the range0
..(text.getEndIndex() - text.getBeginIndex())
Constructs anInputMethodEvent
with the specified source component type caret and visiblePosition. The text is set tonull
committedCharacterCount
to 0.The offsets of
caret
andvisiblePosition
are relative to the current composed text; that is the composed text within thetext
of the precedingINPUT_METHOD_TEXT_CHANGED
event if the event being constructed as aCARET_POSITION_CHANGED
event. For anINPUT_METHOD_TEXT_CHANGED
event without textcaret
andvisiblePosition
must benull
. The time stamp for this event is initialized by invoking java.awt.EventQueue#getMostRecentEventTime() @param sourceThethe object where the event originated.@param idThethe event type.@param caret the caret (a.k.a. insertion point).;Nullnull
if there's no caret within current composed text.@param visiblePositionThethe position that's most important to be visible.;Nullnull
if there's no recommendation for a visible position within current composed text @exception IllegalArgumentException ifid
is not in the rangeINPUT_METHOD_FIRST
..INPUT_METHOD_LAST
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
An event which executes theClass InvocationEvent, constructor InvocationEvent(Object, Runnable)run()
method on aRunnable
when dispatched by the AWT event dispatcher thread. This class can be used as a reference implementation ofActiveEvent
rather than declaring a new class and definingdispatch()
.Instances of this class are placed on the
EventQueue
by calls toinvokeLater
andinvokeAndWait
. Client code can use this fact to write replacement functions forinvokeLater
andinvokeAndWait
without writing special-case code in anyAWTEventListener
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
Constructs anClass InvocationEvent, constructor InvocationEvent(Object, Runnable, Object, boolean)InvocationEvent
with the specified source which will execute the runnable'srun
method when dispatched. @param source the()Object
that originated the event @param runnable theRunnable
whoserun
method will be executed()
Constructs anClass InvocationEvent, constructor InvocationEvent(Object, int, Runnable, Object, boolean)InvocationEvent
with the specified source which will execute the runnable'srun
method when dispatched. If notifier is non-()null
notifyAll()
will be called on it immediately afterrun
returns. @param source the()Object
that originated the event @param runnable theRunnable
whoserun
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
'srun
method or should instead propagate those Exceptions to the EventDispatchThread's dispatch loop()
Constructs anInvocationEvent
with the specified source and ID which will execute the runnable'srun
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 theObject
that originated the event @param id the ID for theEventevent @param runnable theRunnable
whoserun
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
'srun
method or should instead propagate those Exceptions to the EventDispatchThread's dispatch loop()
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 orClass ItemEvent, constructor ItemEvent(ItemSelectable, int, Object, int)de-selecteddeselected by the user. The event is passed to everyItemListener
object which registered to receive such events using the component'saddItemListener
method.The object that implements the
ItemListener
interface gets thisItemEvent
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
Constructs anClass ItemEvent, int DESELECTEDItemEvent
object.Note that passing in an invalid
id
results in unspecified behavior. @param source theItemSelectable
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
This state-change-value indicates that a selected item wasun-selecteddeselected.
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'sClass ItemListener, void itemStateChanged(ItemEvent)addItemListener
method. When an item-selection event occurs the listener object'sitemStateChanged
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
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).
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 theKeyListener
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 theKeyEvent
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
An event which indicates that a keystroke occurred in a component.Class KeyEvent, constructor KeyEvent(Component, int, long, int, int, char)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
orKeyAdapter
object which registered to receive such events using the component'saddKeyListener
method. (KeyAdapter
objects implement theKeyListener
interface.) Each such listener object gets thisKeyEvent
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:
- Key combinations which do not result in Unicode characters such as action keys like F1 and the HELP key do not generate KEY_TYPED events.
- Not all keyboards or systems are capable of generating all virtual key codes. No attempt is made in Java to artificially generate these keys.
- Virtual key codes do not identify a physical key they depend on the platform and keyboard layout. For example the key that on a Windows U.S. keyboard layout generates VK_Q generates VK_A on a Windows French keyboard layout.
- In order to support the platform-independent handling of action keys the Java platform uses a few additional virtual key constants for functions that would otherwise have to be recognized by interpreting virtual key codes and modifiers. For example for Japanese Windows keyboards VK_ALL_CANDIDATES is returned instead of VK_CONVERT with the ALT
modifermodifier.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.
44580412/0603/0001 @see KeyAdapter @see KeyListener @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @since 1.1
Constructs aClass KeyEvent, char getKeyChar()KeyEvent
object.Note that passing in an invalid
id
results in unspecified behavior. @param source theComponent
that originated the event @param id an integer identifying the type of event @param when a long integer thatspecifysspecifies 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 ifid
isKEY_TYPED
andkeyChar
isCHAR_UNDEFINED
; or ifid
isKEY_TYPED
andkeyCode
is notVK_UNDEFINED
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 integerClass KeyEvent, String getKeyText(int)key-codekeyCode associated with the key in this event. @return the integer code for an actual key on the keyboard. (ForKEY_TYPED
events the keyCode isVK_UNDEFINED
.)
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 keyCodeClass KeyEvent, boolean isActionKey()
Returns whetherClass KeyEvent, String paramString()or notthe key in this event is an "action" key.as defined inTypically an actionEvent.javakey does not fire a unicode character and is not a modifier key. @returnboolean valuetrue
if the key is an "action" key@seefalse
Eventotherwise
Returns a parameter string identifying this event. This method is useful for eventClass KeyEvent, void setModifiers(int)-logging and for debugging. @return a string identifying the event and its attributes
Set the modifiers to indicate additional keys that were held down (e.g. shift ctrl alt meta) defined as part of InputEvent.Class KeyEvent, void setSource(Object)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, int VK_KP_DOWNSetRetargetsthean event to a new source. This method is typically used to retarget an event to a lightweight child Component ofthisthe originalKeyEventheavyweight source.Dispatching this event subsequent to this operation will send thisThis method is intended to be used only by event
totargetingthe newsubsystems suchObjectas client-defined KeyboardFocusManagers. It is not for general client use. @param newSource theKeyEvent'snewsource.Object to which the event should be dispatched
Constant for theClass KeyEvent, int VK_KP_LEFTkey padnumericarrowkeypad downfunctionarrow key. @see #VK_DOWN @since 1.2
Constant for theClass KeyEvent, int VK_KP_RIGHTkey padnumericarrowkeypad leftfunctionarrow key. @see #VK_LEFT @since 1.2
Constant for theClass KeyEvent, int VK_KP_UPkey padnumericarrowkeypad rightfunctionarrow key. @see #VK_RIGHT @since 1.2
Constant for theClass KeyEvent, int VK_UNDEFINEDkey padnumericarrowkeypad upfunctionarrow key. @see #VK_UP @since 1.2
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.
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 abstractClass KeyListener, void keyPressed(KeyEvent)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 theKeyEvent
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
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 forkeyKeyEventpress is followed byfor a definition of a keyreleasetyped event.
Class MouseEvent, constructor MouseEvent(Component, int, long, int, int, int, int, boolean)/**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:
- Mouse Events
- a mouse button is pressed
- a mouse button is released
- a mouse button is clicked (pressed and released)
- the mouse cursor enters
athe unobscured part of component's geometry- the mouse cursor exits
athe unobscured part of component's geometry- Mouse Motion Events
- the mouse is moved
- the mouse is dragged
A
MouseEvent
object is passed to everyMouseListener
orMouseAdapter
object which is registered to receive the "interesting" mouse events using the component'saddMouseListener
method. (MouseAdapter
objects implement theMouseListener
interface.) Each such listener object gets aMouseEvent
containing the mouse event.A
MouseEvent
object is also passed to everyMouseMotionListener
orMouseMotionAdapter
object which is registered to receive mouse motion events using the component'saddMouseMotionListener
method. (MouseMotionAdapter
objects implement theMouseMotionListener
interface.) Each such listener object gets aMouseEvent
containing the mouse motion event.When a mouse button is clicked events are generated and sent to the registered
MouseListenersMouseListener
s.withThethestate of modal keys can be retrieved using InputEvent#getModifiers and InputEvent#getModifiersEx The button masksetreturned 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 modifierfieldkeys). To get the state of all buttons and modifier keys use InputEvent#getModifiersEx The button which has changed state is returned by MouseEvent#getButtonFor example if the first mouse button is pressed events are sent in the following order:
id modifiers buttonWhen multiple mouse buttons are pressed each press release and click results in a separate event.MOUSE_PRESSED
:BUTTON1_MASK
BUTTON1
MOUSE_RELEASED
:BUTTON1_MASK
BUTTON1
MOUSE_CLICKED
:BUTTON1_MASK
BUTTON1
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 buttonIfMOUSE_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
button2button 2 is released first theMOUSE_RELEASED
/MOUSE_CLICKED
pair forBUTTON2_MASK
arrives first followed by the pair forBUTTON1_MASK
.
MOUSE_DRAGGED
events are delivered to theComponent
in which the mouse button was pressed until the mouse button is released (regardless of whether the mouse position is within the bounds of theComponent
). Due to platform-dependent Drag&Drop implementationsMOUSE_DRAGGED
events may not be delivered during a native Drag&Drop operation. In a multi-screen environment mouse drag events are delivered to theComponent
even if the mouse position is outside the bounds of theGraphicsConfiguration
associated with thatComponent
. However the reported position for mouse drag events in this case may differ from the actual mouse position:. @author Carl Quinn
- In a multi-screen environment without a virtual device:
The reported coordinates for mouse drag events are clipped to fit within the bounds of theGraphicsConfiguration
associated with theComponent
.- 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 theComponent
@version1.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
Constructs aClass MouseEvent, int getClickCount()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 theComponent
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, Point getPoint()ReturnReturns the number of mouse clicks associated with this event. @return integer value for the number of clicks
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 popupClass MouseEvent, void translatePoint(int, int)-menu trigger event for the platform.Note: Popup menus are triggered differently on different systems. Therefore
isPopupTrigger
should be checked in bothmousePressed
andmouseReleased
for proper cross-platform functionality. @return boolean true if this event is the popup-menu trigger for this platform
Translates the event's coordinates to a new position by adding specifiedClass MouseEvent, int MOUSE_CLICKEDx
(horizontal) andy
(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
The "mouse clicked" event. This MouseEvent
occurs when a mouse button is pressed and released.
Class MouseEvent, int MOUSE_DRAGGEDThe "mouse dragged" event. ThisClass MouseEvent, int MOUSE_ENTEREDMouseMotionEvent
occurs when the mouse position changes whilethea"drag"mousemodifierbutton isactive (for example the shift key)pressed.
The "mouse entered" event. ThisClass MouseEvent, int MOUSE_EXITEDMouseEvent
occurs when the mouse cursor entersathe unobscured part of component'sareageometry.
The "mouse exited" event. ThisClass MouseEvent, int MOUSE_MOVEDMouseEvent
occurs when the mouse cursorleavesexitsathe unobscured part of component'sareageometry.
The "mouse moved" event. This MouseMotionEvent
occurs when the mouse position changes.
Class MouseEvent, int MOUSE_PRESSEDThe "mouse pressed" event. This MouseEvent
occurs when a mouse button is pushed down.
Class MouseEvent, int MOUSE_RELEASEDThe "mouse released" event. This MouseEvent
occurs when a mouse button is let up.
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 theClass MouseListener, void mouseClicked(MouseEvent)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 theMouseEvent
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
Invoked when the mouse button has been clicked (pressed and released) on a component.
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 theMouseMotionListener
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 theMouseEvent
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
The listener interface for receiving mouse motion events on a component. (For clicks and other mouse events use theClass MouseMotionListener, void mouseDragged(MouseEvent)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 theMouseEvent
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
Invoked when a mouse button is pressed on a component and then dragged.Class MouseMotionListener, void mouseMoved(MouseEvent)MouseMOUSE_DRAGGED
dragevents will continue to be delivered to the component where thefirstdrag 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.
Invoked when the mouse button has been moved on a component (with no buttonsnodown).
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.Class PaintEvent, constructor PaintEvent(Component, int, Rectangle)14 0216 12/0203/0001 @since 1.1
Constructs aPaintEvent
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
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 everyClass TextEvent, constructor TextEvent(Object, int)TextListener
object which registered to receive such events using the component'saddTextListener
method.The object that implements the
TextListener
interface gets thisTextEvent
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
Constructs aTextEvent
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
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'saddTextListener
method. When the component's text changes the listener object'stextValueChanged
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
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 theWindowListener
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 theWindowEvent
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
A low-level eventClass WindowEvent, constructor WindowEvent(Window, int)whichthat indicates that a window has changed its status. This low-level event is generated by a Window object when it is opened closedaboutactivated deactivatedto close activatediconified or deiconified ordeactivatedwheniconifiedfocus is transfered into ordeconifiedout of the Window.The event is passed to every
WindowListener
orWindowAdapter
object which registered to receive such events using the window'saddWindowListener
method. (WindowAdapter
objects implement theWindowListener
interface.) Each such listener object gets thisWindowEvent
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) @since1JDK1.1
Constructs aClass WindowEvent, int WINDOW_ACTIVATEDWindowEvent
object.Note that passing in an invalid
id
results in unspecified behavior. @param source theWindow
object that originated the event @param id an integer indicating the type of event
The windowClass WindowEvent, int WINDOW_DEACTIVATED-activated event type. This event is delivered when thewindowWindow becomes theuser'sactive Window. Only a Frame or a Dialog can be the activewindowWindow.which meansThe nativethatwindowing system may denote thewindowactive Window(orone ofits childrenitswith special decorations such as asubcomponents)highlightedwilltitlereceivebar. The active Window is always either the focused Window or the first Frame or Dialog that is an owner of thekeyboard eventsfocused Window.
The window-deactivated event type. This event is delivered whenathewindowWindow is no longer theuser'sactivewindowWindow.which means keyboard events will no longerOnly a Frame or a Dialog can bedeliveredthe active Window.toThe native windowing system may denote thewindowactive Window or itssubcomponentschildren 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.
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 abstractClass WindowListener, void windowActivated(WindowEvent)WindowAdapter
class (overriding only the methods of interest). The listener object created from that class is then registered with a Window using the window'saddWindowListener
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 theWindowEvent
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
Invoked when theClass WindowListener, void windowDeactivated(WindowEvent)windowWindow is set to be theuser'sactive Window. Only a Frame or a Dialog can be the activewindowWindow. The native windowing systemwhich meansmay denote thewindowactive Window(orone ofits childrenitswith special decorations such as a highlightedsubcomponents)titlewillbar. The active Window is always either the focused Window orreceivethe first Frame or Dialog that is an owner of thekeyboard eventsfocused Window.
Invoked when awindowWindow is no longer theuser'sactivewindow whichWindow.means that keyboard events will no longerOnly a Frame or a Dialog can bedeliveredthe active Window. The nativetowindowing system may denote thewindowactive Window or itssubcomponentschildren 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.