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#addEventListeneraddAWTEventListener @see java.awt.Toolkit#removeEventListenerremoveAWTEventListener @author Fred Ecks @version 1.2 076 02/2702/9800 @author Fredsince Ecks1.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.18 0921 02/2102/9800 @author Carlsince Quinn1.1


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.10 0913 02/2102/9800 @author Carlsince Quinn1.1

Class AdjustmentEvent

The adjustment event emitted by Adjustable objects. @see java.awt.Adjustable @see AdjustmentListener @author Amy Fowler @version 1.17 0921 02/2102/9800 @author Amysince Fowler1.1
Class AdjustmentEvent, int getAdjustmentType()

Returns the type of adjustment which caused the value changed event. @see #UNIT_INCREMENT @see #UNIT_DECREMENT @see #BLOCK_INCREMENT @see #BLOCK_DECREMENT @see #TRACK

Class AdjustmentListener

The listener interface for receiving adjustment events. @author Amy Fowler @version 1.8 0911 02/2102/9800 @author Amysince Fowler1.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.10 0913 02/2102/9800 @author Carlsince Quinn1.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.18 0921 02/2102/9800 @author Carlsince Quinn1.1


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.10 0913 02/2102/9800 @author Carlsince Quinn1.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.6 099 02/2102/9800 @author Amysince Fowler1.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) @version 1.8 09/21/98 @author Tim Prinzing @author Amy Fowler @version 1.11 02/02/00 @since 1.1


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) @version 1.5 09/21/98 @author Tim Prinzing @author Amy Fowler @version 1.8 02/02/00 @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.10 0913 02/2102/9800 @author Carlsince Quinn1.1


Class FocusEvent

A low-level event which indicates that a component has gained or lost the keyboard focus. This low-level event is generated by a component (such as a text field). The event is passed to every FocusListener or FocusAdapter object which registered to receive such events using the component'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 component to another such as through calls to requestFocus() or as the user uses the Tab key to traverse components. Temporary focus change events occur when focus is temporarily gained or lost for a component as the indirect result of another operation such as window deactivation or a scrollbar drag. In this case the original focus state will automatically be restored once that operation is finished or for the case of window deactivation when the window is reactivated. Both permanent and temporary focus events are delivered using the FOCUS_GAINED and FOCUS_LOST event ids; the levels 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) @version 1.19 09/21/98 @author Carl Quinn @author Amy Fowler @version 1.22 02/02/00 @since 1.1


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.9 0912 02/2102/9800 @author Carlsince Quinn1.1

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 02/02/00 @see KeyEvent @see KeyAdapter @see MouseEvent @see MouseAdapter @see MouseMotionAdapter @versionsince 1.19 08/31/98 @author Carl Quinn1

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.12 0616 02/2202/9800 @author JavaSoftsince Asia/Pacific1.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. @param source The object where the event originated. @param id The event type. @param text The combined committed and composed text committed text first. AlwaysMust be null forwhen 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 The number of committed characters in the text. @param caret the caret (a.k.a. insertion point). Null if there's no caret within current composed text. @param visiblePosition The position that's most important to be visible. Null 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 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 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 02/02/00 @see InputMethodEvent @see java.awt.im.InputMethodRequests @versionsince 1.5 09/21/98 @author JavaSoft Asia/Pacific2


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 EventQueueListenerAWTEventListener objects. @author Fred Ecks @author David Mendenhall @version 1.9 02/02/00 @see java.awt.ActiveEvent @see java.awt.EventQueue#invokeLater @see java.awt.EventQueue#invokeAndWait @see EventQueueListenerAWTEventListener @versionsince 1.4 05/19/98 @author Fred Ecks @author David Mendenhall2

Class InvocationEvent, int INVOCATION_FIRST

Marks the first integer id for the range of invokeinvocation event ids.
Class InvocationEvent, int INVOCATION_LAST

Marks the last integer id for the range of invokeinvocation event ids.

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-selected. 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 02/02/00 @author Carl Quinn @see java.awt.ItemSelectable @see ItemListener @see Tutorial: Writing an Item Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.18 09/21/98 @author Carl Quinn1


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 02/02/00 @see ItemSelectable @see ItemEvent @see Tutorial: Writing an Item Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.10 09/21/98 @author Amy Fowler1

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 02/02/00 @see KeyEvent @see KeyListener @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.10 09/21/98 @author Carl Quinn1


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 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 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 (like "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.43 02/11/00 @see KeyAdapter @see KeyListener @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.38 12/08/98 @author Carl Quinn @author Amy Fowler @author Norbert Lindenberg1

Class KeyEvent, int VK_ALL_CANDIDATES

Constant for the All Candidates function key. @since 1.2
Class KeyEvent, int VK_ALPHANUMERIC

Constant for the Alphanumeric function key. @since 1.2
Class KeyEvent, int VK_ALT_GRAPH

Constant for the AltGraph modifierfunction key. @since 1.2
Class KeyEvent, int VK_AT

Constant for the "@" key. @since 1.2
Class KeyEvent, int VK_CIRCUMFLEX

Constant for the "^" key. @since 1.2
Class KeyEvent, int VK_CODE_INPUT

Constant for the Code Input function key. @since 1.2
Class KeyEvent, int VK_COLON

Constant for the ":" key. @since 1.2
Class KeyEvent, int VK_COMPOSE

Constant for the Compose function key. @since 1.2
Class KeyEvent, int VK_DOLLAR

Constant for the "$" key. @since 1.2
Class KeyEvent, int VK_EURO_SIGN

Constant for the Euro currency sign key. @since 1.2
Class KeyEvent, int VK_EXCLAMATION_MARK

Constant for the " " key. @since 1.2
Class KeyEvent, int VK_F13

Constant for the F13 function key. @since 1.2
Class KeyEvent, int VK_F14

Constant for the F14 function key. @since 1.2
Class KeyEvent, int VK_F15

Constant for the F15 function key. @since 1.2
Class KeyEvent, int VK_F16

Constant for the F16 function key. @since 1.2
Class KeyEvent, int VK_F17

Constant for the F17 function key. @since 1.2
Class KeyEvent, int VK_F18

Constant for the F18 function key. @since 1.2
Class KeyEvent, int VK_F19

Constant for the F19 function key. @since 1.2
Class KeyEvent, int VK_F20

Constant for the F20 function key. @since 1.2
Class KeyEvent, int VK_F21

Constant for the F21 function key. @since 1.2
Class KeyEvent, int VK_F22

Constant for the F22 function key. @since 1.2
Class KeyEvent, int VK_F23

Constant for the F23 function key. @since 1.2
Class KeyEvent, int VK_F24

Constant for the F24 function key. @since 1.2
Class KeyEvent, int VK_FULL_WIDTH

Constant for the Full-Width Characters function key. @since 1.2
Class KeyEvent, int VK_HALF_WIDTH

Constant for the Half-Width Characters function key. @since 1.2
Class KeyEvent, int VK_HIRAGANA

Constant for the Hiragana function key. @since 1.2
Class KeyEvent, int VK_INVERTED_EXCLAMATION_MARK

Constant for the inverted exclamation mark key. @since 1.2
Class KeyEvent, int VK_JAPANESE_HIRAGANA

Constant for the Japanese-Hiragana function key. This key switches to a Japanese input method and selects its Hiragana input mode. @since 1.2
Class KeyEvent, int VK_JAPANESE_KATAKANA

Constant for the Japanese-Katakana function key. This key switches to a Japanese input method and selects its Katakana input mode. @since 1.2
Class KeyEvent, int VK_JAPANESE_ROMAN

Constant for the Japanese-Roman function key. This key switches to a Japanese input method and selects its Roman-Direct input mode. @since 1.2
Class KeyEvent, int VK_KATAKANA

Constant for the Katakana function key. @since 1.2
Class KeyEvent, int VK_KP_UP

Constant for KeyPadthe key cursorpad arrow keysup function key. @since 1.2
Class KeyEvent, int VK_LEFT_PARENTHESIS

Constant for the "(" key. @since 1.2
Class KeyEvent, int VK_NUMBER_SIGN

Constant for the "#" key. @since 1.2
Class KeyEvent, int VK_PLUS

Constant for the "+" key. @since 1.2
Class KeyEvent, int VK_PREVIOUS_CANDIDATE

Constant for the Previous Candidate function key. @since 1.2
Class KeyEvent, int VK_RIGHT_PARENTHESIS

Constant for the ")" key. @since 1.2
Class KeyEvent, int VK_ROMAN_CHARACTERS

Constant for the Roman Characters function key. @since 1.2
Class KeyEvent, int VK_UNDERSCORE

Constant for the "_" key. @since 1.2

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 02/02/00 @see KeyAdapter @see KeyEvent @see Tutorial: Writing a Key Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.10 09/21/98 @author Carl Quinn1


Class MouseAdapter

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

Mouse events let you track when a mouse is pressed released clicked when it enters a component and when it exits. (To track mouse moves and mouse drags use the MouseMotionAdapter.)

Extend this class to create a MouseEvent listener and override the methods for the events of interest. (If you implement the MouseListener 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 addMouseListener method. When a mouse button is pressed released or clicked (pressed and released) or when the mouse cursor enters or exits the component the relevant method in the listener object is invoked and the MouseEvent is passed to it. @author Carl Quinn @version 1.8 08/02/97 @see MouseEvent @see MouseListener @see Tutorial: Writing a Mouse Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.8 08/02/97 @author Carl Quinn1


Class MouseEvent

/** An event which indicates that a mouse action occurred in a component. 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 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 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 MouseListeners with the button mask set in the modifier field. For example if the first mouse button is pressed events are sent in the following order:

 MOUSE_PRESSED: BUTTON1_MASK MOUSE_RELEASED: BUTTON1_MASK MOUSE_CLICKED: BUTTON1_MASK 
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 releases them in the same order the following sequence of events is generated:

 MOUSE_PRESSED: BUTTON1_MASK MOUSE_PRESSED: BUTTON2_MASK MOUSE_RELEASED: BUTTON1_MASK MOUSE_CLICKED: BUTTON1_MASK MOUSE_RELEASED: BUTTON2_MASK MOUSE_CLICKED: BUTTON2_MASK 
If button2 is released first the MOUSE_RELEASED/MOUSE_CLICKED pair for BUTTON2_MASK arrives first followed by the pair for BUTTON1_MASK. @author Carl Quinn @version 1.26 02/02/00 @see MouseAdapter @see MouseListener @see MouseMotionAdapter @see MouseMotionListnerMouseMotionListener @see Tutorial: Writing a Mouse Listener @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.22 04/22/99 @author Carl Quinn1

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 02/02/00 @see MouseAdapter @see MouseEvent @see Tutorial: Writing a Mouse Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.7 08/02/97 @author Carl Quinn1


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 02/02/00 @see MouseEvent @see MouseMotionListener @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.8 09/21/98 @author Amy Fowler1


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 02/02/00 @see MouseMotionAdapter @see MouseEvent @see Tutorial: Writing a Mouse Motion Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.6 09/21/98 @author Amy Fowler1


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.11 0914 02/2102/9800 @author Amysince Fowler1.1

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 02/02/00 @see java.awt.TextComponent @see TextListener @see Tutorial: Writing a Text Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.8 09/21/98 @author Georges Saab1


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 02/02/00 @see TextEvent @see Tutorial: Writing a Text Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.6 09/21/98 @author Georges Saab1

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 WindowrListenerWindowListener 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) @version 1.11 09/21/98 @author Carl Quinn @author Amy Fowler @version 1.15 02/02/00 @since 1.1


Class WindowEvent

A low-level event which indicates that a window has changed its status. This low-level event is generated by a Window object when it is opened closed about to close activated or deactivated iconified or deconified.

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 02/02/00 @see WindowAdapter @see WindowListener @see Tutorial: Writing a Window Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.17 07/29/98 @author Carl Quinn @author Amy Fowler1

Class WindowEvent, int WINDOW_ICONIFIED

The window iconified event. This event is delivered when the window has been changed from a normal to a minimized state. For many platforms a minimized window is displayed as the icon specified in the window's iconImage property. @see java.awt.Frame#setIconImage

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 winodwwindow'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 sis invoked and the WindowEvent is passed to it. @author Carl Quinn @version 1.16 02/02/00 @see WindowAdapter @see WindowEvent @see Tutorial: Writing a Window Listener @see Reference: The Java Class Libraries (update file) @versionsince 1.11 09/21/98 @author Carl Quinn1
Class WindowListener, void windowIconified(WindowEvent)

Invoked when a window is changed from a normal to a minimized state. For many platforms a minimized window is displayed as the icon specified in the window's iconImage property. @see java.awt.Frame#setIconImage