|
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#addEventListeneraddAWTEventListener @see java.awt.Toolkit#removeEventListenerremoveAWTEventListener @author Fred Ecks @version 1.2 076 02/2702/9800 @author FredsinceEcks1.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 everyActionListener
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.18 0921 02/2102/9800 @author CarlsinceQuinn1.1
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.10 0913 02/2102/9800 @author CarlsinceQuinn1.1
The adjustment event emitted by Adjustable objects. @see java.awt.Adjustable @see AdjustmentListener @author Amy Fowler @version 1.Class AdjustmentEvent, int getAdjustmentType()17 0921 02/2102/9800 @author AmysinceFowler1.1
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
The listener interface for receiving adjustment events. @author Amy Fowler @version 1.8 0911 02/2102/9800 @author AmysinceFowler1.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.10 0913 02/2102/9800 @author CarlsinceQuinn1.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).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.18 0921 02/2102/9800 @author CarlsinceQuinn1.1
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.10 0913 02/2102/9800 @author CarlsinceQuinn1.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.6 099 02/2102/9800 @author AmysinceFowler1.1
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
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) @version 1.8 09/21/98 @author Tim Prinzing @author Amy Fowler @version 1.11 02/02/00 @since 1.1
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) @version 1.5 09/21/98 @author Tim Prinzing @author Amy Fowler @version 1.8 02/02/00 @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.10 0913 02/2102/9800 @author CarlsinceQuinn1.1
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 everyFocusListener
orFocusAdapter
object which registered to receive such events using the component'saddFocusListener
method. (FocusAdapter
objects implement theFocusListener
interface.) Each such listener object gets thisFocusEvent
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
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.9 0912 02/2102/9800 @author CarlsinceQuinn1.1
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
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.
12 0616 02/2202/9800 @author JavaSoftsinceAsia/Pacific1.2
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 anINPUT_METHOD_TEXT_CHANGED
event the composed text within thetext
of the precedingINPUT_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 benull
forwhen the event type isCARET_POSITION_CHANGED
; may be null forINPUT_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 ifid
is not in the rangeINPUT_METHOD_FIRST
..INPUT_METHOD_LAST
if id isCARET_POSITION_CHANGED
andtext
is not null or ifcommittedCharacterCount
is not in the range0
..(text.getEndIndex() - text.getBeginIndex())
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
An event which executes theClass InvocationEvent, int INVOCATION_FIRSTrun()
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 anyobjects. @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
EventQueueListenerAWTEventListenerEventQueueListenerAWTEventListener @versionsince 1.4 05/19/98 @author Fred Ecks @author David Mendenhall2
Marks the first integer id for the range ofClass InvocationEvent, int INVOCATION_LASTinvokeinvocation event ids.
Marks the last integer id for the range ofinvokeinvocation event ids.
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 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 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
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'saddItemListener
method. When an item-selection event occurs the listener object'sitemStateChanged
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
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 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
An event which indicates that a keystroke occurred in a component.Class KeyEvent, int VK_ALL_CANDIDATESThis 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 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:
- Key combinations which do not result in 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 modifer.
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
Constant for the All Candidates function key. @since 1.2Class KeyEvent, int VK_ALPHANUMERIC
Constant for the Alphanumeric function key. @since 1.2Class KeyEvent, int VK_ALT_GRAPH
Constant for the AltGraphClass KeyEvent, int VK_ATmodifierfunction key. @since 1.2
Constant for the "@" key. @since 1.2Class KeyEvent, int VK_CIRCUMFLEX
Constant for the "^" key. @since 1.2Class KeyEvent, int VK_CODE_INPUT
Constant for the Code Input function key. @since 1.2Class KeyEvent, int VK_COLON
Constant for the ":" key. @since 1.2Class KeyEvent, int VK_COMPOSE
Constant for the Compose function key. @since 1.2Class KeyEvent, int VK_DOLLAR
Constant for the "$" key. @since 1.2Class KeyEvent, int VK_EURO_SIGN
Constant for the Euro currency sign key. @since 1.2Class KeyEvent, int VK_EXCLAMATION_MARK
Constant for the " " key. @since 1.2Class KeyEvent, int VK_F13
Constant for the F13 function key. @since 1.2Class KeyEvent, int VK_F14
Constant for the F14 function key. @since 1.2Class KeyEvent, int VK_F15
Constant for the F15 function key. @since 1.2Class KeyEvent, int VK_F16
Constant for the F16 function key. @since 1.2Class KeyEvent, int VK_F17
Constant for the F17 function key. @since 1.2Class KeyEvent, int VK_F18
Constant for the F18 function key. @since 1.2Class KeyEvent, int VK_F19
Constant for the F19 function key. @since 1.2Class KeyEvent, int VK_F20
Constant for the F20 function key. @since 1.2Class KeyEvent, int VK_F21
Constant for the F21 function key. @since 1.2Class KeyEvent, int VK_F22
Constant for the F22 function key. @since 1.2Class KeyEvent, int VK_F23
Constant for the F23 function key. @since 1.2Class KeyEvent, int VK_F24
Constant for the F24 function key. @since 1.2Class KeyEvent, int VK_FULL_WIDTH
Constant for the Full-Width Characters function key. @since 1.2Class KeyEvent, int VK_HALF_WIDTH
Constant for the Half-Width Characters function key. @since 1.2Class KeyEvent, int VK_HIRAGANA
Constant for the Hiragana function key. @since 1.2Class KeyEvent, int VK_INVERTED_EXCLAMATION_MARK
Constant for the inverted exclamation mark key. @since 1.2Class 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.2Class 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.2Class 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.2Class KeyEvent, int VK_KATAKANA
Constant for the Katakana function key. @since 1.2Class KeyEvent, int VK_KP_UP
Constant forClass KeyEvent, int VK_LEFT_PARENTHESISKeyPadthe keycursorpad arrowkeysup function key. @since 1.2
Constant for the "(" key. @since 1.2Class KeyEvent, int VK_NUMBER_SIGN
Constant for the "#" key. @since 1.2Class KeyEvent, int VK_PLUS
Constant for the "+" key. @since 1.2Class KeyEvent, int VK_PREVIOUS_CANDIDATE
Constant for the Previous Candidate function key. @since 1.2Class KeyEvent, int VK_RIGHT_PARENTHESIS
Constant for the ")" key. @since 1.2Class KeyEvent, int VK_ROMAN_CHARACTERS
Constant for the Roman Characters function key. @since 1.2Class KeyEvent, int VK_UNDERSCORE
Constant for the "_" key. @since 1.2
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 abstractKeyAdapter
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 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
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 theMouseListener
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 theMouseEvent
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
/** 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:
- Mouse Events
- a mouse button is pressed
- a mouse button is released
- a mouse button is clicked (pressed and released)
- the mouse cursor enters a component
- the mouse cursor exits a component
- Mouse Motion Events
- the mouse is moved
- the mouse is dragged
A MouseEvent object is passed to every
MouseListener
orMouseAdapter
object which 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 every
MouseMotionListener
orMouseMotionAdapter
object which 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 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_MASKWhen 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_MASKIf 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 @seeMouseMotionListnerMouseMotionListener @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
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 theMouseEvent
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
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 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
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 theMouseEvent
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
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 AmysinceFowler1.1
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 everyTextListener
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 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
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 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
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 theinterface 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.)
WindowrListenerWindowListenerCreate 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) @version 1.11 09/21/98 @author Carl Quinn @author Amy Fowler @version 1.15 02/02/00 @since 1.1
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.Class WindowEvent, int WINDOW_ICONIFIEDThe 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 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
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
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 windowIconified(WindowEvent)WindowAdapter
class (overriding only the methods of interest). The listener object created from that class is then registered with a Window using thewinodwwindow'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 objectsis invoked and theWindowEvent
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
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