All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.Event
java.lang.Object
|
+----java.awt.Event
- public class Event
- extends Object
- implements Serializable
Event is a platform-independent class that encapsulates events from
the local Graphical User Interface(GUI) platform.
The event contains an id which indicates the type
of event it is and which other Event variables are relavent for the event.
For keyboard events, key will contain a value indicating
the key that was activated and modifiers will
contain the modifiers. For KEY_PRESS and KEY_RELEASE event ids, the value of key
will be the unicode character code for the key; for KEY_ACTION and KEY_ACTION_RELEASE,
the value of key will be one of the defined action-key identifiers in the Event
class (PGUP, PGDN, F1, F2, etc).
-
ACTION_EVENT
- An action event.
-
ALT_MASK
-
The alt modifier constant.
-
arg
- An arbitrary argument.
-
BACK_SPACE
- The BackSpace key.
-
CAPS_LOCK
- The CapsLock action-key.
-
clickCount
- The number of consecutive clicks.
-
CTRL_MASK
- The control modifier constant.
-
DELETE
- The Delete key.
-
DOWN
- The down arrow action-key.
-
END
-
The end action-key.
-
ENTER
- The Enter key.
-
ESCAPE
- The Escape key.
-
evt
- The next event.
-
F1
- The F1 function action-key.
-
F10
- The F10 function action-key.
-
F11
- The F11 function action-key.
-
F12
- The F12 function action-key.
-
F2
- The F2 function action-key.
-
F3
- The F3 function action-key.
-
F4
- The F4 function action-key.
-
F5
- The F5 function action-key.
-
F6
- The F6 function action-key.
-
F7
- The F7 function action-key.
-
F8
- The F8 function action-key.
-
F9
- The F9 function action-key.
-
GOT_FOCUS
- A component gained the focus.
-
HOME
-
The home action-key.
-
id
- The type of this event.
-
INSERT
- The Insert key.
-
key
-
The key code that was pressed in a keyboard event.
-
KEY_ACTION
-
The action-key press keyboard event.
-
KEY_ACTION_RELEASE
-
The action-key release keyboard event.
-
KEY_PRESS
- The key press keyboard event.
-
KEY_RELEASE
- The key release keyboard event.
-
LEFT
- The left arrow action-key.
-
LIST_DESELECT
-
-
LIST_SELECT
-
-
LOAD_FILE
- A file loading event.
-
LOST_FOCUS
- A component lost the focus.
-
META_MASK
-
The meta modifier constant.
-
modifiers
-
The state of the modifier keys.
-
MOUSE_DOWN
- The mouse down event.
-
MOUSE_DRAG
-
The mouse drag event.
-
MOUSE_ENTER
- The mouse enter event.
-
MOUSE_EXIT
- The mouse exit event.
-
MOUSE_MOVE
- The mouse move event.
-
MOUSE_UP
- The mouse up event.
-
NUM_LOCK
- The NumLock action-key.
-
PAUSE
- The Pause action-key.
-
PGDN
- The page down action-key.
-
PGUP
- The page up action-key.
-
PRINT_SCREEN
- The PrintScreen action-key.
-
RIGHT
- The right arrow action-key.
-
SAVE_FILE
- A file saving event.
-
SCROLL_ABSOLUTE
- The absolute scroll event.
-
SCROLL_BEGIN
- The scroll begin event.
-
SCROLL_END
- The scroll end event.
-
SCROLL_LINE_DOWN
- The line down scroll event.
-
SCROLL_LINE_UP
-
The line up scroll event.
-
SCROLL_LOCK
- The ScrollLock action-key.
-
SCROLL_PAGE_DOWN
- The page down scroll event.
-
SCROLL_PAGE_UP
- The page up scroll event.
-
SHIFT_MASK
- The shift modifier constant.
-
TAB
- The Tab key.
-
target
- The target component.
-
UP
- The up arrow action-key.
-
when
- The time stamp.
-
WINDOW_DEICONIFY
-
The de-iconify window event.
-
WINDOW_DESTROY
- The destroy window event.
-
WINDOW_EXPOSE
- The expose window event.
-
WINDOW_ICONIFY
-
The iconify window event.
-
WINDOW_MOVED
- The move window event.
-
x
-
The x coordinate of the event.
-
y
-
The y coordinate of the event.
-
Event(Object, int, Object)
- Constructs an event with the specified target component,
event type, and argument.
-
Event(Object, long, int, int, int, int, int)
- Constructs an 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 to null.
-
Event(Object, long, int, int, int, int, int, Object)
- Constructs an event with the specified target component, time stamp,
event type, x and y coordinates, keyboard key, state of the modifier
keys and argument.
-
controlDown()
- Checks if the control key is down.
-
metaDown()
- Checks if the meta key is down.
-
paramString()
- Returns the parameter String of this Event.
-
shiftDown()
- Checks if the shift key is down.
-
toString()
- Returns the String representation of this Event's values.
-
translate(int, int)
-
Translates an event relative to the given component.
SHIFT_MASK
Properties Public Constant
SHIFT_MASK=int
- The shift modifier constant.
CTRL_MASK
Properties Public Constant
CTRL_MASK=int
- The control modifier constant.
META_MASK
Properties Public Constant
META_MASK=int
- The meta modifier constant.
ALT_MASK
Properties Public Constant
ALT_MASK=int
- The alt modifier constant.
HOME
Properties Public Constant
HOME=int
- The home action-key.
END
Properties Public Constant
END=int
- The end action-key.
PGUP
Properties Public Constant
PGUP=int
- The page up action-key.
PGDN
Properties Public Constant
PGDN=int
- The page down action-key.
UP
Properties Public Constant
UP=int
- The up arrow action-key.
DOWN
Properties Public Constant
DOWN=int
- The down arrow action-key.
LEFT
Properties Public Constant
LEFT=int
- The left arrow action-key.
RIGHT
Properties Public Constant
RIGHT=int
- The right arrow action-key.
F1
Properties Public Constant
F1=int
- The F1 function action-key.
F2
Properties Public Constant
F2=int
- The F2 function action-key.
F3
Properties Public Constant
F3=int
- The F3 function action-key.
F4
Properties Public Constant
F4=int
- The F4 function action-key.
F5
Properties Public Constant
F5=int
- The F5 function action-key.
F6
Properties Public Constant
F6=int
- The F6 function action-key.
F7
Properties Public Constant
F7=int
- The F7 function action-key.
F8
Properties Public Constant
F8=int
- The F8 function action-key.
F9
Properties Public Constant
F9=int
- The F9 function action-key.
F10
Properties Public Constant
F10=int
- The F10 function action-key.
F11
Properties Public Constant
F11=int
- The F11 function action-key.
F12
Properties Public Constant
F12=int
- The F12 function action-key.
PRINT_SCREEN
Properties Public Constant
PRINT_SCREEN=int
- The PrintScreen action-key.
SCROLL_LOCK
Properties Public Constant
SCROLL_LOCK=int
- The ScrollLock action-key.
CAPS_LOCK
Properties Public Constant
CAPS_LOCK=int
- The CapsLock action-key.
NUM_LOCK
Properties Public Constant
NUM_LOCK=int
- The NumLock action-key.
PAUSE
Properties Public Constant
PAUSE=int
- The Pause action-key.
INSERT
Properties Public Constant
INSERT=int
- The Insert key.
ENTER
Properties Public Constant
ENTER=int
- The Enter key.
BACK_SPACE
Properties Public Constant
BACK_SPACE=int
- The BackSpace key.
TAB
Properties Public Constant
TAB=int
- The Tab key.
ESCAPE
Properties Public Constant
ESCAPE=int
- The Escape key.
DELETE
Properties Public Constant
DELETE=int
- The Delete key.
WINDOW_DESTROY
Properties Public Constant
WINDOW_DESTROY=int
- The destroy window event.
WINDOW_EXPOSE
Properties Public Constant
WINDOW_EXPOSE=int
- The expose window event.
WINDOW_ICONIFY
Properties Public Constant
WINDOW_ICONIFY=int
- The iconify window event.
WINDOW_DEICONIFY
Properties Public Constant
WINDOW_DEICONIFY=int
- The de-iconify window event.
WINDOW_MOVED
Properties Public Constant
WINDOW_MOVED=int
- The move window event.
KEY_PRESS
Properties Public Constant
KEY_PRESS=int
- The key press keyboard event.
KEY_RELEASE
Properties Public Constant
KEY_RELEASE=int
- The key release keyboard event.
KEY_ACTION
Properties Public Constant
KEY_ACTION=int
- The action-key press keyboard event.
KEY_ACTION_RELEASE
Properties Public Constant
KEY_ACTION_RELEASE=int
- The action-key release keyboard event.
MOUSE_DOWN
Properties Public Constant
MOUSE_DOWN=int
- The mouse down event.
MOUSE_UP
Properties Public Constant
MOUSE_UP=int
- The mouse up event.
MOUSE_MOVE
Properties Public Constant
MOUSE_MOVE=int
- The mouse move event.
MOUSE_ENTER
Properties Public Constant
MOUSE_ENTER=int
- The mouse enter event.
MOUSE_EXIT
Properties Public Constant
MOUSE_EXIT=int
- The mouse exit event.
MOUSE_DRAG
Properties Public Constant
MOUSE_DRAG=int
- The mouse drag event.
SCROLL_LINE_UP
Properties Public Constant
SCROLL_LINE_UP=int
- The line up scroll event.
SCROLL_LINE_DOWN
Properties Public Constant
SCROLL_LINE_DOWN=int
- The line down scroll event.
SCROLL_PAGE_UP
Properties Public Constant
SCROLL_PAGE_UP=int
- The page up scroll event.
SCROLL_PAGE_DOWN
Properties Public Constant
SCROLL_PAGE_DOWN=int
- The page down scroll event.
SCROLL_ABSOLUTE
Properties Public Constant
SCROLL_ABSOLUTE=int
- The absolute scroll event.
SCROLL_BEGIN
Properties Public Constant
SCROLL_BEGIN=int
- The scroll begin event.
SCROLL_END
Properties Public Constant
SCROLL_END=int
- The scroll end event.
LIST_SELECT
Properties Public Constant
LIST_SELECT=int
LIST_DESELECT
Properties Public Constant
LIST_DESELECT=int
ACTION_EVENT
Properties Public Constant
ACTION_EVENT=int
- An action event.
LOAD_FILE
Properties Public Constant
LOAD_FILE=int
- A file loading event.
SAVE_FILE
Properties Public Constant
SAVE_FILE=int
- A file saving event.
GOT_FOCUS
Properties Public Constant
GOT_FOCUS=int
- A component gained the focus.
LOST_FOCUS
Properties Public Constant
LOST_FOCUS=int
- A component lost the focus.
target
Properties Public
target=Object
- The target component.
when
Properties Public
when=long
- The time stamp.
id
Properties Public
id=int
- The type of this event.
x
Properties Public
x=int
- The x coordinate of the event.
y
Properties Public
y=int
- The y coordinate of the event.
key
Properties Public
key=int
- The key code that was pressed in a keyboard event.
modifiers
Properties Public
modifiers=int
- The state of the modifier keys.
clickCount
Properties Public
clickCount=int
- The number of consecutive clicks. This field is relevant only for
MOUSE_DOWN events. If the field isn't set it will be 0. Otherwise,
it will be 1 for single-clicks, 2 for double-clicks, and so on.
arg
Properties Public
arg=Object
- An arbitrary argument.
evt
Properties Public
evt=Event
- The next event. Used when putting events into a linked list.
Event
method Event(target=Object, -
when=long, -
id=int, -
x=int, -
y=int, -
key=int, -
modifiers=int, -
arg=Object) public
- Constructs an event with 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
Event
method Event(target=Object, -
when=long, -
id=int, -
x=int, -
y=int, -
key=int, -
modifiers=int) public
- Constructs an 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 to null.
- 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
Event
method Event(target=Object, -
id=int, -
arg=Object) public
- Constructs an event with the specified target component,
event type, and argument.
- Parameters:
- target - the target component
- id - the event type
- arg - the specified argument
translate
method translate(x=int, -
y=int) public
- Translates an event relative to the given component. This
involves at a minimum translating the coordinates so they make
sense within the given component. It may also involve
translating a region in the case of an expose event.
- Parameters:
- x - the x coordinate
- y - the y coordinate
shiftDown
method shiftDown() returns boolean public
- Checks if the shift key is down.
- See Also:
- modifiers, controlDown, metaDown
controlDown
method controlDown() returns boolean public
- Checks if the control key is down.
- See Also:
- modifiers, shiftDown, metaDown
metaDown
method metaDown() returns boolean public
- Checks if the meta key is down.
- See Also:
- modifiers, shiftDown, controlDown
paramString
method paramString() returns String Inheritable
- Returns the parameter String of this Event.
toString
method toString() returns String public
- Returns the String representation of this Event's values.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index