java.awt
Class Event

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Event
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class Event
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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 sample code for java.awt.Event.id definition code for java.awt.Event.id field that indicates what type of event it is and which other Event variables are relevant for the event.

For keyboard events, key sample code for java.awt.Event.key definition code for java.awt.Event.key contains a value indicating which key was activated, and modifiers sample code for java.awt.Event.modifiers definition code for java.awt.Event.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:
JDK1.0
See Also:
Serialized Form

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

Field Detail

SHIFT_MASK sample code for java.awt.Event.SHIFT_MASK

public static final int SHIFT_MASK
This flag indicates that the Shift key was down when the event occurred.

See Also:
Constant Field Values

CTRL_MASK sample code for java.awt.Event.CTRL_MASK

public static final int CTRL_MASK
This flag indicates that the Control key was down when the event occurred.

See Also:
Constant Field Values

META_MASK sample code for java.awt.Event.META_MASK

public static final int META_MASK
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:
Constant Field Values

ALT_MASK sample code for java.awt.Event.ALT_MASK

public static final int ALT_MASK
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:
Constant Field Values

HOME sample code for java.awt.Event.HOME

public static final int HOME
The Home key, a non-ASCII action key.

See Also:
Constant Field Values

END sample code for java.awt.Event.END

public static final int END
The End key, a non-ASCII action key.

See Also:
Constant Field Values

PGUP sample code for java.awt.Event.PGUP

public static final int PGUP
The Page Up key, a non-ASCII action key.

See Also:
Constant Field Values

PGDN sample code for java.awt.Event.PGDN

public static final int PGDN
The Page Down key, a non-ASCII action key.

See Also:
Constant Field Values

UP sample code for java.awt.Event.UP

public static final int UP
The Up Arrow key, a non-ASCII action key.

See Also:
Constant Field Values

DOWN sample code for java.awt.Event.DOWN

public static final int DOWN
The Down Arrow key, a non-ASCII action key.

See Also:
Constant Field Values

LEFT sample code for java.awt.Event.LEFT

public static final int LEFT
The Left Arrow key, a non-ASCII action key.

See Also:
Constant Field Values

RIGHT sample code for java.awt.Event.RIGHT

public static final int RIGHT
The Right Arrow key, a non-ASCII action key.

See Also:
Constant Field Values

F1 sample code for java.awt.Event.F1

public static final int F1
The F1 function key, a non-ASCII action key.

See Also:
Constant Field Values

F2 sample code for java.awt.Event.F2

public static final int F2
The F2 function key, a non-ASCII action key.

See Also:
Constant Field Values

F3 sample code for java.awt.Event.F3

public static final int F3
The F3 function key, a non-ASCII action key.

See Also:
Constant Field Values

F4 sample code for java.awt.Event.F4

public static final int F4
The F4 function key, a non-ASCII action key.

See Also:
Constant Field Values

F5 sample code for java.awt.Event.F5

public static final int F5
The F5 function key, a non-ASCII action key.

See Also:
Constant Field Values

F6 sample code for java.awt.Event.F6

public static final int F6
The F6 function key, a non-ASCII action key.

See Also:
Constant Field Values

F7 sample code for java.awt.Event.F7

public static final int F7
The F7 function key, a non-ASCII action key.

See Also:
Constant Field Values

F8 sample code for java.awt.Event.F8

public static final int F8
The F8 function key, a non-ASCII action key.

See Also:
Constant Field Values

F9 sample code for java.awt.Event.F9

public static final int F9
The F9 function key, a non-ASCII action key.

See Also:
Constant Field Values

F10 sample code for java.awt.Event.F10

public static final int F10
The F10 function key, a non-ASCII action key.

See Also:
Constant Field Values

F11 sample code for java.awt.Event.F11

public static final int F11
The F11 function key, a non-ASCII action key.

See Also:
Constant Field Values

F12 sample code for java.awt.Event.F12

public static final int F12
The F12 function key, a non-ASCII action key.

See Also:
Constant Field Values

PRINT_SCREEN sample code for java.awt.Event.PRINT_SCREEN

public static final int PRINT_SCREEN
The Print Screen key, a non-ASCII action key.

See Also:
Constant Field Values

SCROLL_LOCK sample code for java.awt.Event.SCROLL_LOCK

public static final int SCROLL_LOCK
The Scroll Lock key, a non-ASCII action key.

See Also:
Constant Field Values

CAPS_LOCK sample code for java.awt.Event.CAPS_LOCK

public static final int CAPS_LOCK
The Caps Lock key, a non-ASCII action key.

See Also:
Constant Field Values

NUM_LOCK sample code for java.awt.Event.NUM_LOCK

public static final int NUM_LOCK
The Num Lock key, a non-ASCII action key.

See Also:
Constant Field Values

PAUSE sample code for java.awt.Event.PAUSE

public static final int PAUSE
The Pause key, a non-ASCII action key.

See Also:
Constant Field Values

INSERT sample code for java.awt.Event.INSERT

public static final int INSERT
The Insert key, a non-ASCII action key.

See Also:
Constant Field Values

ENTER sample code for java.awt.Event.ENTER

public static final int ENTER
The Enter key.

See Also:
Constant Field Values

BACK_SPACE sample code for java.awt.Event.BACK_SPACE

public static final int BACK_SPACE
The BackSpace key.

See Also:
Constant Field Values

TAB sample code for java.awt.Event.TAB

public static final int TAB
The Tab key.

See Also:
Constant Field Values

ESCAPE sample code for java.awt.Event.ESCAPE

public static final int ESCAPE
The Escape key.

See Also:
Constant Field Values

DELETE sample code for java.awt.Event.DELETE

public static final int DELETE
The Delete key.

See Also:
Constant Field Values

WINDOW_DESTROY sample code for java.awt.Event.WINDOW_DESTROY

public static final int WINDOW_DESTROY
The user has asked the window manager to kill the window.

See Also:
Constant Field Values

WINDOW_EXPOSE sample code for java.awt.Event.WINDOW_EXPOSE

public static final int WINDOW_EXPOSE
The user has asked the window manager to expose the window.

See Also:
Constant Field Values

WINDOW_ICONIFY sample code for java.awt.Event.WINDOW_ICONIFY

public static final int WINDOW_ICONIFY
The user has asked the window manager to iconify the window.

See Also:
Constant Field Values

WINDOW_DEICONIFY sample code for java.awt.Event.WINDOW_DEICONIFY

public static final int WINDOW_DEICONIFY
The user has asked the window manager to de-iconify the window.

See Also:
Constant Field Values

WINDOW_MOVED sample code for java.awt.Event.WINDOW_MOVED

public static final int WINDOW_MOVED
The user has asked the window manager to move the window.

See Also:
Constant Field Values

KEY_PRESS sample code for java.awt.Event.KEY_PRESS

public static final int KEY_PRESS
The user has pressed a normal key.

See Also:
Constant Field Values

KEY_RELEASE sample code for java.awt.Event.KEY_RELEASE

public static final int KEY_RELEASE
The user has released a normal key.

See Also:
Constant Field Values

KEY_ACTION sample code for java.awt.Event.KEY_ACTION

public static final int KEY_ACTION
The user has pressed a non-ASCII action key. The 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.

See Also:
Constant Field Values

KEY_ACTION_RELEASE sample code for java.awt.Event.KEY_ACTION_RELEASE

public static final int KEY_ACTION_RELEASE
The user has released a non-ASCII action key. The 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.

See Also:
Constant Field Values

MOUSE_DOWN sample code for java.awt.Event.MOUSE_DOWN

public static final int MOUSE_DOWN
The user has pressed the mouse button. The ALT_MASK flag indicates that the middle button has been pressed. The META_MASKflag indicates that the right button has been pressed.

See Also:
ALT_MASK sample code for java.awt.Event.ALT_MASK definition code for java.awt.Event.ALT_MASK , META_MASK sample code for java.awt.Event.META_MASK definition code for java.awt.Event.META_MASK , Constant Field Values

MOUSE_UP sample code for java.awt.Event.MOUSE_UP

public static final int MOUSE_UP
The user has released the mouse button. The ALT_MASK flag indicates that the middle button has been released. The META_MASKflag indicates that the right button has been released.

See Also:
ALT_MASK sample code for java.awt.Event.ALT_MASK definition code for java.awt.Event.ALT_MASK , META_MASK sample code for java.awt.Event.META_MASK definition code for java.awt.Event.META_MASK , Constant Field Values

MOUSE_MOVE sample code for java.awt.Event.MOUSE_MOVE

public static final int MOUSE_MOVE
The mouse has moved with no button pressed.

See Also:
Constant Field Values

MOUSE_ENTER sample code for java.awt.Event.MOUSE_ENTER

public static final int MOUSE_ENTER
The mouse has entered a component.

See Also:
Constant Field Values

MOUSE_EXIT sample code for java.awt.Event.MOUSE_EXIT

public static final int MOUSE_EXIT
The mouse has exited a component.

See Also:
Constant Field Values

MOUSE_DRAG sample code for java.awt.Event.MOUSE_DRAG

public static final int MOUSE_DRAG
The user has moved the mouse with a button pressed. The ALT_MASK flag indicates that the middle button is being pressed. The META_MASK flag indicates that the right button is being pressed.

See Also:
ALT_MASK sample code for java.awt.Event.ALT_MASK definition code for java.awt.Event.ALT_MASK , META_MASK sample code for java.awt.Event.META_MASK definition code for java.awt.Event.META_MASK , Constant Field Values

SCROLL_LINE_UP sample code for java.awt.Event.SCROLL_LINE_UP

public static final int SCROLL_LINE_UP
The user has activated the line up area of a scroll bar.

See Also:
Constant Field Values

SCROLL_LINE_DOWN sample code for java.awt.Event.SCROLL_LINE_DOWN

public static final int SCROLL_LINE_DOWN
The user has activated the line down area of a scroll bar.

See Also:
Constant Field Values

SCROLL_PAGE_UP sample code for java.awt.Event.SCROLL_PAGE_UP

public static final int SCROLL_PAGE_UP
The user has activated the page up area of a scroll bar.

See Also:
Constant Field Values

SCROLL_PAGE_DOWN sample code for java.awt.Event.SCROLL_PAGE_DOWN

public static final int SCROLL_PAGE_DOWN
The user has activated the page down area of a scroll bar.

See Also:
Constant Field Values

SCROLL_ABSOLUTE sample code for java.awt.Event.SCROLL_ABSOLUTE

public static final 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.

See Also:
Constant Field Values

SCROLL_BEGIN sample code for java.awt.Event.SCROLL_BEGIN

public static final int SCROLL_BEGIN
The scroll begin event.

See Also:
Constant Field Values

SCROLL_END sample code for java.awt.Event.SCROLL_END

public static final int SCROLL_END
The scroll end event.

See Also:
Constant Field Values

LIST_SELECT sample code for java.awt.Event.LIST_SELECT

public static final int LIST_SELECT
An item in a list has been selected.

See Also:
Constant Field Values

LIST_DESELECT sample code for java.awt.Event.LIST_DESELECT

public static final int LIST_DESELECT
An item in a list has been deselected.

See Also:
Constant Field Values

ACTION_EVENT sample code for java.awt.Event.ACTION_EVENT

public static final int ACTION_EVENT
This event indicates that the user wants some action to occur.

See Also:
Constant Field Values

LOAD_FILE sample code for java.awt.Event.LOAD_FILE

public static final int LOAD_FILE
A file loading event.

See Also:
Constant Field Values

SAVE_FILE sample code for java.awt.Event.SAVE_FILE

public static final int SAVE_FILE
A file saving event.

See Also:
Constant Field Values

GOT_FOCUS sample code for java.awt.Event.GOT_FOCUS

public static final int GOT_FOCUS
A component gained the focus.

See Also:
Constant Field Values

LOST_FOCUS sample code for java.awt.Event.LOST_FOCUS

public static final int LOST_FOCUS
A component lost the focus.

See Also:
Constant Field Values

target sample code for java.awt.Event.target

public Object sample code for java.lang.Object definition code for java.lang.Object  target
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:
EventObject.getSource() sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource()

when sample code for java.awt.Event.when

public long when
The time stamp. Replaced by InputEvent.getWhen().

See Also:
InputEvent.getWhen() sample code for java.awt.event.InputEvent.getWhen() definition code for java.awt.event.InputEvent.getWhen()

id sample code for java.awt.Event.id

public int id
Indicates which type of event the event is, and which other Event variables are relevant for the event. This has been replaced by AWTEvent.getID()

See Also:
AWTEvent.getID() sample code for java.awt.AWTEvent.getID() definition code for java.awt.AWTEvent.getID()

x sample code for java.awt.Event.x

public int x
The x coordinate of the event. Replaced by MouseEvent.getX()

See Also:
MouseEvent.getX() sample code for java.awt.event.MouseEvent.getX() definition code for java.awt.event.MouseEvent.getX()

y sample code for java.awt.Event.y

public int y
The y coordinate of the event. Replaced by MouseEvent.getY()

See Also:
MouseEvent.getY() sample code for java.awt.event.MouseEvent.getY() definition code for java.awt.event.MouseEvent.getY()

key sample code for java.awt.Event.key

public int key
The key code of the key that was pressed in a keyboard event. This has been replaced by KeyEvent.getKeyCode()

See Also:
KeyEvent.getKeyCode() sample code for java.awt.event.KeyEvent.getKeyCode() definition code for java.awt.event.KeyEvent.getKeyCode()

modifiers sample code for java.awt.Event.modifiers

public int modifiers
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:
InputEvent.getModifiers() sample code for java.awt.event.InputEvent.getModifiers() definition code for java.awt.event.InputEvent.getModifiers()

clickCount sample code for java.awt.Event.clickCount

public int clickCount
For MOUSE_DOWN events, this field indicates the number of consecutive clicks. For other events, its value is 0. This field has been replaced by MouseEvent.getClickCount().

See Also:
MouseEvent.getClickCount(). sample code for java.awt.event.MouseEvent.getClickCount() definition code for java.awt.event.MouseEvent.getClickCount()

arg sample code for java.awt.Event.arg

public Object sample code for java.lang.Object definition code for java.lang.Object  arg
An arbitrary argument of the event. The value of this field depends on the type of event. arg has been replaced by event specific property.


evt sample code for java.awt.Event.evt

public Event sample code for java.awt.Event definition code for java.awt.Event  evt
The next event. This field is set when putting events into a linked list. This has been replaced by EventQueue.

See Also:
EventQueue sample code for java.awt.EventQueue definition code for java.awt.EventQueue
Constructor Detail

Event sample code for java.awt.Event(java.lang.Object, long, int, int, int, int, int, java.lang.Object) definition code for java.awt.Event(java.lang.Object, long, int, int, int, int, int, java.lang.Object)

public Event(Object sample code for java.lang.Object definition code for java.lang.Object  target,
             long when,
             int id,
             int x,
             int y,
             int key,
             int modifiers,
             Object sample code for java.lang.Object definition code for java.lang.Object  arg)
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class 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 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 sample code for java.awt.Event(java.lang.Object, long, int, int, int, int, int) definition code for java.awt.Event(java.lang.Object, long, int, int, int, int, int)

public Event(Object sample code for java.lang.Object definition code for java.lang.Object  target,
             long when,
             int id,
             int x,
             int y,
             int key,
             int modifiers)
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class 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 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 sample code for java.awt.Event(java.lang.Object, int, java.lang.Object) definition code for java.awt.Event(java.lang.Object, int, java.lang.Object)

public Event(Object sample code for java.lang.Object definition code for java.lang.Object  target,
             int id,
             Object sample code for java.lang.Object definition code for java.lang.Object  arg)
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class and its subclasses.

Creates an instance of Event with the specified target component, event type, and argument.

Parameters:
target - the target component.
id - the event type.
arg - the specified argument.
Method Detail

translate sample code for java.awt.Event.translate(int, int) definition code for java.awt.Event.translate(int, int)

public void translate(int dx,
                      int dy)
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class 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.

shiftDown sample code for java.awt.Event.shiftDown() definition code for java.awt.Event.shiftDown()

public boolean shiftDown()
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class and its subclasses.

Checks if the Shift key is down.

Returns:
true if the key is down; false otherwise.
See Also:
modifiers sample code for java.awt.Event.modifiers definition code for java.awt.Event.modifiers , controlDown() sample code for java.awt.Event.controlDown() definition code for java.awt.Event.controlDown() , metaDown() sample code for java.awt.Event.metaDown() definition code for java.awt.Event.metaDown()

controlDown sample code for java.awt.Event.controlDown() definition code for java.awt.Event.controlDown()

public boolean controlDown()
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class and its subclasses.

Checks if the Control key is down.

Returns:
true if the key is down; false otherwise.
See Also:
modifiers sample code for java.awt.Event.modifiers definition code for java.awt.Event.modifiers , shiftDown() sample code for java.awt.Event.shiftDown() definition code for java.awt.Event.shiftDown() , metaDown() sample code for java.awt.Event.metaDown() definition code for java.awt.Event.metaDown()

metaDown sample code for java.awt.Event.metaDown() definition code for java.awt.Event.metaDown()

public boolean metaDown()
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class and its subclasses.

Checks if the Meta key is down.

Returns:
true if the key is down; false otherwise.
See Also:
modifiers sample code for java.awt.Event.modifiers definition code for java.awt.Event.modifiers , shiftDown() sample code for java.awt.Event.shiftDown() definition code for java.awt.Event.shiftDown() , controlDown() sample code for java.awt.Event.controlDown() definition code for java.awt.Event.controlDown()

paramString sample code for java.awt.Event.paramString() definition code for java.awt.Event.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class 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 be null.

Returns:
the parameter string of this event

toString sample code for java.awt.Event.toString() definition code for java.awt.Event.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
NOTE: The Event class is obsolete and is available only for backwards compatilibility. It has been replaced by the AWTEvent class and its subclasses.

Returns a representation of this event's values as a string.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string that represents the event and the values of its member fields.
Since:
JDK1.1
See Also:
paramString() sample code for java.awt.Event.paramString() definition code for java.awt.Event.paramString()