- All Implemented Interfaces:
- Serializable
Event class is obsolete and is
 available only for backwards compatibility.  It has been replaced
 by the AWTEvent class and its subclasses.
 
 Event is a platform-independent class that
 encapsulates events from the platform's Graphical User
 Interface in the Java 1.0 event model. In Java 1.1
 and later versions, the Event class is maintained
 only for backwards compatibility. The information in this
 class description is provided to assist programmers in
 converting Java 1.0 programs to the new event model.
 
 In the Java 1.0 event model, an event contains an
 id field
 that indicates what type of event it is and which other
 Event variables are relevant for the event.
 
 For keyboard events, key
 contains a value indicating which key was activated, and
 modifiers contains the
 modifiers for that event.  For the KEY_PRESS and KEY_RELEASE
 event ids, the value of key is the unicode
 character code for the key. For KEY_ACTION and
 KEY_ACTION_RELEASE, the value of key is
 one of the defined action-key identifiers in the
 Event class (PGUP,
 PGDN, F1, F2, etc).
- Since:
- 1.0
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDeprecated.This event indicates that the user wants some action to occur.static final intDeprecated.This flag indicates that the Alt key was down when the event occurred.Deprecated.An arbitrary argument of the event.static final intDeprecated.The BackSpace key.static final intDeprecated.The Caps Lock key, a non-ASCII action key.intDeprecated.ForMOUSE_DOWNevents, this field indicates the number of consecutive clicks.static final intDeprecated.This flag indicates that the Control key was down when the event occurred.static final intDeprecated.The Delete key.static final intDeprecated.The Down Arrow key, a non-ASCII action key.static final intDeprecated.The End key, a non-ASCII action key.static final intDeprecated.The Enter key.static final intDeprecated.The Escape key.Deprecated.The next event.static final intDeprecated.The F1 function key, a non-ASCII action key.static final intDeprecated.The F10 function key, a non-ASCII action key.static final intDeprecated.The F11 function key, a non-ASCII action key.static final intDeprecated.The F12 function key, a non-ASCII action key.static final intDeprecated.The F2 function key, a non-ASCII action key.static final intDeprecated.The F3 function key, a non-ASCII action key.static final intDeprecated.The F4 function key, a non-ASCII action key.static final intDeprecated.The F5 function key, a non-ASCII action key.static final intDeprecated.The F6 function key, a non-ASCII action key.static final intDeprecated.The F7 function key, a non-ASCII action key.static final intDeprecated.The F8 function key, a non-ASCII action key.static final intDeprecated.The F9 function key, a non-ASCII action key.static final intDeprecated.A component gained the focus.static final intDeprecated.The Home key, a non-ASCII action key.intDeprecated.Indicates which type of event the event is, and which otherEventvariables are relevant for the event.static final intDeprecated.The Insert key, a non-ASCII action key.intDeprecated.The key code of the key that was pressed in a keyboard event.static final intDeprecated.The user has pressed a non-ASCII action key.static final intDeprecated.The user has released a non-ASCII action key.static final intDeprecated.The user has pressed a normal key.static final intDeprecated.The user has released a normal key.static final intDeprecated.The Left Arrow key, a non-ASCII action key.static final intDeprecated.An item in a list has been deselected.static final intDeprecated.An item in a list has been selected.static final intDeprecated.A file loading event.static final intDeprecated.A component lost the focus.static final intDeprecated.This flag indicates that the Meta key was down when the event occurred.intDeprecated.The state of the modifier keys.static final intDeprecated.The user has pressed the mouse button.static final intDeprecated.The user has moved the mouse with a button pressed.static final intDeprecated.The mouse has entered a component.static final intDeprecated.The mouse has exited a component.static final intDeprecated.The mouse has moved with no button pressed.static final intDeprecated.The user has released the mouse button.static final intDeprecated.The Num Lock key, a non-ASCII action key.static final intDeprecated.The Pause key, a non-ASCII action key.static final intDeprecated.The Page Down key, a non-ASCII action key.static final intDeprecated.The Page Up key, a non-ASCII action key.static final intDeprecated.The Print Screen key, a non-ASCII action key.static final intDeprecated.The Right Arrow key, a non-ASCII action key.static final intDeprecated.A file saving event.static final intDeprecated.The user has moved the bubble (thumb) in a scroll bar, moving to an "absolute" position, rather than to an offset from the last position.static final intDeprecated.The scroll begin event.static final intDeprecated.The scroll end event.static final intDeprecated.The user has activated the line down area of a scroll bar.static final intDeprecated.The user has activated the line up area of a scroll bar.static final intDeprecated.The Scroll Lock key, a non-ASCII action key.static final intDeprecated.The user has activated the page down area of a scroll bar.static final intDeprecated.The user has activated the page up area of a scroll bar.static final intDeprecated.This flag indicates that the Shift key was down when the event occurred.static final intDeprecated.The Tab key.Deprecated.The target component.static final intDeprecated.The Up Arrow key, a non-ASCII action key.longDeprecated.The time stamp.static final intDeprecated.The user has asked the window manager to de-iconify the window.static final intDeprecated.The user has asked the window manager to kill the window.static final intDeprecated.The user has asked the window manager to expose the window.static final intDeprecated.The user has asked the window manager to iconify the window.static final intDeprecated.The user has asked the window manager to move the window.intDeprecated.The x coordinate of the event.intDeprecated.The y coordinate of the event.
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.booleanmetaDown()Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.protected StringDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.booleanDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.toString()Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.voidtranslate(int dx, int dy) Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility.
- 
Field Details- 
SHIFT_MASKpublic static final int SHIFT_MASKDeprecated.This flag indicates that the Shift key was down when the event occurred.- See Also:
 
- 
CTRL_MASKpublic static final int CTRL_MASKDeprecated.This flag indicates that the Control key was down when the event occurred.- See Also:
 
- 
META_MASKpublic static final int META_MASKDeprecated.This flag indicates that the Meta key was down when the event occurred. For mouse events, this flag indicates that the right button was pressed or released.- See Also:
 
- 
ALT_MASKpublic static final int ALT_MASKDeprecated.This flag indicates that the Alt key was down when the event occurred. For mouse events, this flag indicates that the middle mouse button was pressed or released.- See Also:
 
- 
HOMEpublic static final int HOMEDeprecated.The Home key, a non-ASCII action key.- See Also:
 
- 
ENDpublic static final int ENDDeprecated.The End key, a non-ASCII action key.- See Also:
 
- 
PGUPpublic static final int PGUPDeprecated.The Page Up key, a non-ASCII action key.- See Also:
 
- 
PGDNpublic static final int PGDNDeprecated.The Page Down key, a non-ASCII action key.- See Also:
 
- 
UPpublic static final int UPDeprecated.The Up Arrow key, a non-ASCII action key.- See Also:
 
- 
DOWNpublic static final int DOWNDeprecated.The Down Arrow key, a non-ASCII action key.- See Also:
 
- 
LEFTpublic static final int LEFTDeprecated.The Left Arrow key, a non-ASCII action key.- See Also:
 
- 
RIGHTpublic static final int RIGHTDeprecated.The Right Arrow key, a non-ASCII action key.- See Also:
 
- 
F1public static final int F1Deprecated.The F1 function key, a non-ASCII action key.- See Also:
 
- 
F2public static final int F2Deprecated.The F2 function key, a non-ASCII action key.- See Also:
 
- 
F3public static final int F3Deprecated.The F3 function key, a non-ASCII action key.- See Also:
 
- 
F4public static final int F4Deprecated.The F4 function key, a non-ASCII action key.- See Also:
 
- 
F5public static final int F5Deprecated.The F5 function key, a non-ASCII action key.- See Also:
 
- 
F6public static final int F6Deprecated.The F6 function key, a non-ASCII action key.- See Also:
 
- 
F7public static final int F7Deprecated.The F7 function key, a non-ASCII action key.- See Also:
 
- 
F8public static final int F8Deprecated.The F8 function key, a non-ASCII action key.- See Also:
 
- 
F9public static final int F9Deprecated.The F9 function key, a non-ASCII action key.- See Also:
 
- 
F10public static final int F10Deprecated.The F10 function key, a non-ASCII action key.- See Also:
 
- 
F11public static final int F11Deprecated.The F11 function key, a non-ASCII action key.- See Also:
 
- 
F12public static final int F12Deprecated.The F12 function key, a non-ASCII action key.- See Also:
 
- 
PRINT_SCREENpublic static final int PRINT_SCREENDeprecated.The Print Screen key, a non-ASCII action key.- See Also:
 
- 
SCROLL_LOCKpublic static final int SCROLL_LOCKDeprecated.The Scroll Lock key, a non-ASCII action key.- See Also:
 
- 
CAPS_LOCKpublic static final int CAPS_LOCKDeprecated.The Caps Lock key, a non-ASCII action key.- See Also:
 
- 
NUM_LOCKpublic static final int NUM_LOCKDeprecated.The Num Lock key, a non-ASCII action key.- See Also:
 
- 
PAUSEpublic static final int PAUSEDeprecated.The Pause key, a non-ASCII action key.- See Also:
 
- 
INSERTpublic static final int INSERTDeprecated.The Insert key, a non-ASCII action key.- See Also:
 
- 
ENTERpublic static final int ENTERDeprecated.The Enter key.- See Also:
 
- 
BACK_SPACEpublic static final int BACK_SPACEDeprecated.The BackSpace key.- See Also:
 
- 
TABpublic static final int TABDeprecated.The Tab key.- See Also:
 
- 
ESCAPEpublic static final int ESCAPEDeprecated.The Escape key.- See Also:
 
- 
DELETEpublic static final int DELETEDeprecated.The Delete key.- See Also:
 
- 
WINDOW_DESTROYpublic static final int WINDOW_DESTROYDeprecated.The user has asked the window manager to kill the window.- See Also:
 
- 
WINDOW_EXPOSEpublic static final int WINDOW_EXPOSEDeprecated.The user has asked the window manager to expose the window.- See Also:
 
- 
WINDOW_ICONIFYpublic static final int WINDOW_ICONIFYDeprecated.The user has asked the window manager to iconify the window.- See Also:
 
- 
WINDOW_DEICONIFYpublic static final int WINDOW_DEICONIFYDeprecated.The user has asked the window manager to de-iconify the window.- See Also:
 
- 
WINDOW_MOVEDpublic static final int WINDOW_MOVEDDeprecated.The user has asked the window manager to move the window.- See Also:
 
- 
KEY_PRESSpublic static final int KEY_PRESSDeprecated.The user has pressed a normal key.- See Also:
 
- 
KEY_RELEASEpublic static final int KEY_RELEASEDeprecated.The user has released a normal key.- See Also:
 
- 
KEY_ACTIONpublic static final int KEY_ACTIONDeprecated.The user has pressed a non-ASCII action key. Thekeyfield contains a value that indicates that the event occurred on one of the action keys, which comprise the 12 function keys, the arrow (cursor) keys, Page Up, Page Down, Home, End, Print Screen, Scroll Lock, Caps Lock, Num Lock, Pause, and Insert.- See Also:
 
- 
KEY_ACTION_RELEASEpublic static final int KEY_ACTION_RELEASEDeprecated.The user has released a non-ASCII action key. Thekeyfield contains a value that indicates that the event occurred on one of the action keys, which comprise the 12 function keys, the arrow (cursor) keys, Page Up, Page Down, Home, End, Print Screen, Scroll Lock, Caps Lock, Num Lock, Pause, and Insert.- See Also:
 
- 
MOUSE_DOWNpublic static final int MOUSE_DOWNDeprecated.The user has pressed the mouse button. TheALT_MASKflag indicates that the middle button has been pressed. TheMETA_MASKflag indicates that the right button has been pressed.- See Also:
 
- 
MOUSE_UPpublic static final int MOUSE_UPDeprecated.The user has released the mouse button. TheALT_MASKflag indicates that the middle button has been released. TheMETA_MASKflag indicates that the right button has been released.- See Also:
 
- 
MOUSE_MOVEpublic static final int MOUSE_MOVEDeprecated.The mouse has moved with no button pressed.- See Also:
 
- 
MOUSE_ENTERpublic static final int MOUSE_ENTERDeprecated.The mouse has entered a component.- See Also:
 
- 
MOUSE_EXITpublic static final int MOUSE_EXITDeprecated.The mouse has exited a component.- See Also:
 
- 
MOUSE_DRAGpublic static final int MOUSE_DRAGDeprecated.The user has moved the mouse with a button pressed. TheALT_MASKflag indicates that the middle button is being pressed. TheMETA_MASKflag indicates that the right button is being pressed.- See Also:
 
- 
SCROLL_LINE_UPpublic static final int SCROLL_LINE_UPDeprecated.The user has activated the line up area of a scroll bar.- See Also:
 
- 
SCROLL_LINE_DOWNpublic static final int SCROLL_LINE_DOWNDeprecated.The user has activated the line down area of a scroll bar.- See Also:
 
- 
SCROLL_PAGE_UPpublic static final int SCROLL_PAGE_UPDeprecated.The user has activated the page up area of a scroll bar.- See Also:
 
- 
SCROLL_PAGE_DOWNpublic static final int SCROLL_PAGE_DOWNDeprecated.The user has activated the page down area of a scroll bar.- See Also:
 
- 
SCROLL_ABSOLUTEpublic static final int SCROLL_ABSOLUTEDeprecated.The user has moved the bubble (thumb) in a scroll bar, moving to an "absolute" position, rather than to an offset from the last position.- See Also:
 
- 
SCROLL_BEGINpublic static final int SCROLL_BEGINDeprecated.The scroll begin event.- See Also:
 
- 
SCROLL_ENDpublic static final int SCROLL_ENDDeprecated.The scroll end event.- See Also:
 
- 
LIST_SELECTpublic static final int LIST_SELECTDeprecated.An item in a list has been selected.- See Also:
 
- 
LIST_DESELECTpublic static final int LIST_DESELECTDeprecated.An item in a list has been deselected.- See Also:
 
- 
ACTION_EVENTpublic static final int ACTION_EVENTDeprecated.This event indicates that the user wants some action to occur.- See Also:
 
- 
LOAD_FILEpublic static final int LOAD_FILEDeprecated.A file loading event.- See Also:
 
- 
SAVE_FILEpublic static final int SAVE_FILEDeprecated.A file saving event.- See Also:
 
- 
GOT_FOCUSpublic static final int GOT_FOCUSDeprecated.A component gained the focus.- See Also:
 
- 
LOST_FOCUSpublic static final int LOST_FOCUSDeprecated.A component lost the focus.- See Also:
 
- 
targetDeprecated.The target component. This indicates the component over which the event occurred or with which the event is associated. This object has been replaced by AWTEvent.getSource()- See Also:
 
- 
whenpublic long whenDeprecated.The time stamp. Replaced by InputEvent.getWhen().- See Also:
 
- 
idpublic int idDeprecated.Indicates which type of event the event is, and which otherEventvariables are relevant for the event. This has been replaced by AWTEvent.getID()- See Also:
 
- 
xpublic int xDeprecated.The x coordinate of the event. Replaced by MouseEvent.getX()- See Also:
 
- 
ypublic int yDeprecated.The y coordinate of the event. Replaced by MouseEvent.getY()- See Also:
 
- 
keypublic int keyDeprecated.The key code of the key that was pressed in a keyboard event. This has been replaced by KeyEvent.getKeyCode()- See Also:
 
- 
modifierspublic int modifiersDeprecated.The state of the modifier keys. This is replaced with InputEvent.getModifiers() In java 1.1 MouseEvent and KeyEvent are subclasses of InputEvent.- See Also:
 
- 
clickCountpublic int clickCountDeprecated.ForMOUSE_DOWNevents, this field indicates the number of consecutive clicks. For other events, its value is0. This field has been replaced by MouseEvent.getClickCount().- See Also:
 
- 
argDeprecated.An arbitrary argument of the event. The value of this field depends on the type of event.arghas been replaced by event specific property.
- 
evtDeprecated.The next event. This field is set when putting events into a linked list. This has been replaced by EventQueue.- See Also:
 
 
- 
- 
Constructor Details- 
EventDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Creates an instance of Eventwith the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and argument.- Parameters:
- target- the target component.
- when- the time stamp.
- id- the event type.
- x- the x coordinate.
- y- the y coordinate.
- key- the key pressed in a keyboard event.
- modifiers- the state of the modifier keys.
- arg- the specified argument.
 
- 
EventDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Creates an instance of Event, with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and an argument set tonull.- Parameters:
- target- the target component.
- when- the time stamp.
- id- the event type.
- x- the x coordinate.
- y- the y coordinate.
- key- the key pressed in a keyboard event.
- modifiers- the state of the modifier keys.
 
- 
EventDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Creates an instance of Eventwith the specified target component, event type, and argument.- Parameters:
- target- the target component.
- id- the event type.
- arg- the specified argument.
 
 
- 
- 
Method Details- 
translatepublic void translate(int dx, int dy) Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Translates this event so that its x and y coordinates are increased by dx and dy, respectively. This method translates an event relative to the given component. This involves, at a minimum, translating the coordinates into the local coordinate system of the given component. It may also involve translating a region in the case of an expose event. - Parameters:
- dx- the distance to translate the x coordinate.
- dy- the distance to translate the y coordinate.
 
- 
shiftDownpublic boolean shiftDown()Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Checks if the Shift key is down. - Returns:
- trueif the key is down;- falseotherwise.
- See Also:
 
- 
controlDownpublic boolean controlDown()Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Checks if the Control key is down. - Returns:
- trueif the key is down;- falseotherwise.
- See Also:
 
- 
metaDownpublic boolean metaDown()Deprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Checks if the Meta key is down. - Returns:
- trueif the key is down;- falseotherwise.
- See Also:
 
- 
paramStringDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Returns a string representing the state of this Event. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.- Returns:
- the parameter string of this event
 
- 
toStringDeprecated.NOTE: TheEventclass is obsolete and is available only for backwards compatibility. It has been replaced by theAWTEventclass and its subclasses.Returns a representation of this event's values as a string. 
 
- 
AWTEventand its subclasses be used instead