|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Event

public class Event


NOTE: The Event class is obsolete and is
available only for backwards compatilibility. 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 compatibilty. 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).
| Field Summary | |
|---|---|
static int |
ACTION_EVENT
This event indicates that the user wants some action to occur. |
static int |
ALT_MASK
This flag indicates that the Alt key was down when the event occurred. |
Object |
arg
An arbitrary argument of the event. |
static int |
BACK_SPACE
The BackSpace key. |
static int |
CAPS_LOCK
The Caps Lock key, a non-ASCII action key. |
int |
clickCount
For MOUSE_DOWN events, this field indicates the
number of consecutive clicks. |
static int |
CTRL_MASK
This flag indicates that the Control key was down when the event occurred. |
static int |
DELETE
The Delete key. |
static int |
DOWN
The Down Arrow key, a non-ASCII action key. |
static int |
END
The End key, a non-ASCII action key. |
static int |
ENTER
The Enter key. |
static int |
ESCAPE
The Escape key. |
Event |
evt
The next event. |
static int |
F1
The F1 function key, a non-ASCII action key. |
static int |
F10
The F10 function key, a non-ASCII action key. |
static int |
F11
The F11 function key, a non-ASCII action key. |
static int |
F12
The F12 function key, a non-ASCII action key. |
static int |
F2
The F2 function key, a non-ASCII action key. |
static int |
F3
The F3 function key, a non-ASCII action key. |
static int |
F4
The F4 function key, a non-ASCII action key. |
static int |
F5
The F5 function key, a non-ASCII action key. |
static int |
F6
The F6 function key, a non-ASCII action key. |
static int |
F7
The F7 function key, a non-ASCII action key. |
static int |
F8
The F8 function key, a non-ASCII action key. |
static int |
F9
The F9 function key, a non-ASCII action key. |
static int |
GOT_FOCUS
A component gained the focus. |
static int |
HOME
The Home key, a non-ASCII action key. |
int |
id
Indicates which type of event the event is, and which other Event variables are relevant for the event. |
static int |
INSERT
The Insert key, a non-ASCII action key. |
int |
key
The key code of the key that was pressed in a keyboard event. |
static int |
KEY_ACTION
The user has pressed a non-ASCII action key. |
static int |
KEY_ACTION_RELEASE
The user has released a non-ASCII action key. |
static int |
KEY_PRESS
The user has pressed a normal key. |
static int |
KEY_RELEASE
The user has released a normal key. |
static int |
LEFT
The Left Arrow key, a non-ASCII action key. |
static int |
LIST_DESELECT
An item in a list has been deselected. |
static int |
LIST_SELECT
An item in a list has been selected. |
static int |
LOAD_FILE
A file loading event. |
static int |
LOST_FOCUS
A component lost the focus. |
static int |
META_MASK
This flag indicates that the Meta key was down when the event occurred. |
int |
modifiers
The state of the modifier keys. |
static int |
MOUSE_DOWN
The user has pressed the mouse button. |
static int |
MOUSE_DRAG
The user has moved the mouse with a button pressed. |
static int |
MOUSE_ENTER
The mouse has entered a component. |
static int |
MOUSE_EXIT
The mouse has exited a component. |
static int |
MOUSE_MOVE
The mouse has moved with no button pressed. |
static int |
MOUSE_UP
The user has released the mouse button. |
static int |
NUM_LOCK
The Num Lock key, a non-ASCII action key. |
static int |
PAUSE
The Pause key, a non-ASCII action key. |
static int |
PGDN
The Page Down key, a non-ASCII action key. |
static int |
PGUP
The Page Up key, a non-ASCII action key. |
static int |
PRINT_SCREEN
The Print Screen key, a non-ASCII action key. |
static int |
RIGHT
The Right Arrow key, a non-ASCII action key. |
static int |
SAVE_FILE
A file saving event. |
static int |
SCROLL_ABSOLUTE
The user has moved the bubble (thumb) in a scroll bar, moving to an "absolute" position, rather than to an offset from the last postion. |
static int |
SCROLL_BEGIN
The scroll begin event. |
static int |
SCROLL_END
The scroll end event. |
static int |
SCROLL_LINE_DOWN
The user has activated the line down area of a scroll bar. |
static int |
SCROLL_LINE_UP
The user has activated the line up area of a scroll bar. |
static int |
SCROLL_LOCK
The Scroll Lock key, a non-ASCII action key. |
static int |
SCROLL_PAGE_DOWN
The user has activated the page down area of a scroll bar. |
static int |
SCROLL_PAGE_UP
The user has activated the page up area of a scroll bar. |
static int |
SHIFT_MASK
This flag indicates that the Shift key was down when the event occurred. |
static int |
TAB
The Tab key. |
Object |
target
The target component. |
static int |
UP
The Up Arrow key, a non-ASCII action key. |
long |
when
The time stamp. |
static int |
WINDOW_DEICONIFY
The user has asked the window manager to de-iconify the window. |
static int |
WINDOW_DESTROY
The user has asked the window manager to kill the window. |
static int |
WINDOW_EXPOSE
The user has asked the window manager to expose the window. |
static int |
WINDOW_ICONIFY
The user has asked the window manager to iconify the window. |
static int |
WINDOW_MOVED
The user has asked the window manager to move the window. |
int |
x
The x coordinate of the event. |
int |
y
The y coordinate of the event. |
| Constructor Summary | |
|---|---|
Event
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
|
Event
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
|
Event
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
|
| Method Summary | |
|---|---|
boolean |
controlDown
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
boolean |
metaDown
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
protected String |
paramString
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
boolean |
shiftDown
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
String |
toString
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
void |
translate
NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |
| Field Detail |
|---|

public static final int SHIFT_MASK

public static final int CTRL_MASK

public static final int META_MASK

public static final int ALT_MASK

public static final int HOME

public static final int END

public static final int PGUP

public static final int PGDN

public static final int UP

public static final int DOWN

public static final int LEFT

public static final int RIGHT

public static final int F1

public static final int F2

public static final int F3

public static final int F4

public static final int F5

public static final int F6

public static final int F7

public static final int F8

public static final int F9

public static final int F10

public static final int F11

public static final int F12

public static final int PRINT_SCREEN

public static final int SCROLL_LOCK

public static final int CAPS_LOCK

public static final int NUM_LOCK

public static final int PAUSE

public static final int INSERT

public static final int ENTER

public static final int BACK_SPACE

public static final int TAB

public static final int ESCAPE

public static final int DELETE

public static final int WINDOW_DESTROY

public static final int WINDOW_EXPOSE

public static final int WINDOW_ICONIFY

public static final int WINDOW_DEICONIFY

public static final int WINDOW_MOVED

public static final int KEY_PRESS

public static final int KEY_RELEASE

public static final int KEY_ACTION
key field 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.

public static final int KEY_ACTION_RELEASE
key field 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.

public static final int MOUSE_DOWN
ALT_MASK
flag indicates that the middle button has been pressed.
The META_MASKflag indicates that the
right button has been pressed.
ALT_MASK
,
META_MASK
,
Constant Field Values

public static final int MOUSE_UP
ALT_MASK
flag indicates that the middle button has been released.
The META_MASKflag indicates that the
right button has been released.
ALT_MASK
,
META_MASK
,
Constant Field Values

public static final int MOUSE_MOVE