Package Summary  Overview Summary

class:Event [NONE]

All Implemented Interfaces:
Serializable

@Deprecated(since="9") public class Eventextends Object implements Serializable
Deprecated.
It is recommended that AWTEvent and its subclasses be used instead
NOTE: The 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:SHIFT_MASK [NONE]

  • SHIFT_MASK

    public static final  int SHIFT_MASK
    Deprecated.
    This flag indicates that the Shift key was down when the event occurred.
    See Also:
  • field:CTRL_MASK [NONE]

    CTRL_MASK

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

    field:META_MASK [NONE]

    META_MASK

    public static final  int META_MASK
    Deprecated.
    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:

    field:ALT_MASK [NONE]

    ALT_MASK

    public static final  int ALT_MASK
    Deprecated.
    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:

    field:HOME [NONE]

    HOME

    public static final  int HOME
    Deprecated.
    The Home key, a non-ASCII action key.
    See Also:

    field:END [NONE]

    END

    public static final  int END
    Deprecated.
    The End key, a non-ASCII action key.
    See Also:

    field:PGUP [NONE]

    PGUP

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

    field:PGDN [NONE]

    PGDN

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

    field:UP [NONE]

    UP

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

    field:DOWN [NONE]

    DOWN

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

    field:LEFT [NONE]

    LEFT

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

    field:RIGHT [NONE]

    field:F1 [NONE]

    F1

    public static final  int F1
    Deprecated.
    The F1 function key, a non-ASCII action key.
    See Also:

    field:F2 [NONE]

    F2

    public static final  int F2
    Deprecated.
    The F2 function key, a non-ASCII action key.
    See Also:

    field:F3 [NONE]

    F3

    public static final  int F3
    Deprecated.
    The F3 function key, a non-ASCII action key.
    See Also:

    field:F4 [NONE]

    F4

    public static final  int F4
    Deprecated.
    The F4 function key, a non-ASCII action key.
    See Also:

    field:F5 [NONE]

    F5

    public static final  int F5
    Deprecated.
    The F5 function key, a non-ASCII action key.
    See Also:

    field:F6 [NONE]

    F6

    public static final  int F6
    Deprecated.
    The F6 function key, a non-ASCII action key.
    See Also:

    field:F7 [NONE]

    F7

    public static final  int F7
    Deprecated.
    The F7 function key, a non-ASCII action key.
    See Also:

    field:F8 [NONE]

    F8

    public static final  int F8
    Deprecated.
    The F8 function key, a non-ASCII action key.
    See Also:

    field:F9 [NONE]

    F9

    public static final  int F9
    Deprecated.
    The F9 function key, a non-ASCII action key.
    See Also:

    field:F10 [NONE]

    F10

    public static final  int F10
    Deprecated.
    The F10 function key, a non-ASCII action key.
    See Also:

    field:F11 [NONE]

    F11

    public static final  int F11
    Deprecated.
    The F11 function key, a non-ASCII action key.
    See Also:

    field:F12 [NONE]

    F12

    public static final  int F12
    Deprecated.
    The F12 function key, a non-ASCII action key.
    See Also:

    field:PRINT_SCREEN [NONE]

    field:SCROLL_LOCK [NONE]

    SCROLL_LOCK

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

    field:CAPS_LOCK [NONE]

    CAPS_LOCK

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

    field:NUM_LOCK [NONE]

    NUM_LOCK

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

    field:PAUSE [NONE]

    PAUSE

    public static final  int PAUSE
    Deprecated.
    The Pause key, a non-ASCII action key.
    See Also:

    field:INSERT [NONE]

    INSERT

    public static final  int INSERT
    Deprecated.
    The Insert key, a non-ASCII action key.
    See Also:

    field:ENTER [NONE]

    ENTER

    public static final  int ENTER
    Deprecated.
    The Enter key.
    See Also:

    field:BACK_SPACE [NONE]

    BACK_SPACE

    public static final  int BACK_SPACE
    Deprecated.
    The BackSpace key.
    See Also:

    field:TAB [NONE]

    TAB

    public static final  int TAB
    Deprecated.
    The Tab key.
    See Also:

    field:ESCAPE [NONE]

    ESCAPE

    public static final  int ESCAPE
    Deprecated.
    The Escape key.
    See Also:

    field:DELETE [NONE]

    DELETE

    public static final  int DELETE
    Deprecated.
    The Delete key.
    See Also:

    field:WINDOW_DESTROY [NONE]

    WINDOW_DESTROY

    public static final  int WINDOW_DESTROY
    Deprecated.
    The user has asked the window manager to kill the window.
    See Also:

    field:WINDOW_EXPOSE [NONE]

    WINDOW_EXPOSE

    public static final  int WINDOW_EXPOSE
    Deprecated.
    The user has asked the window manager to expose the window.
    See Also:

    field:WINDOW_ICONIFY [NONE]

    WINDOW_ICONIFY

    public static final  int WINDOW_ICONIFY
    Deprecated.
    The user has asked the window manager to iconify the window.
    See Also:

    field:WINDOW_DEICONIFY [NONE]

    WINDOW_DEICONIFY

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

    field:WINDOW_MOVED [NONE]

    WINDOW_MOVED

    public static final  int WINDOW_MOVED
    Deprecated.
    The user has asked the window manager to move the window.
    See Also:

    field:KEY_PRESS [NONE]

    KEY_PRESS

    public static final  int KEY_PRESS
    Deprecated.
    The user has pressed a normal key.
    See Also:

    field:KEY_RELEASE [NONE]

    KEY_RELEASE

    public static final  int KEY_RELEASE
    Deprecated.
    The user has released a normal key.
    See Also:

    field:KEY_ACTION [NONE]

    KEY_ACTION

    public static final  int KEY_ACTION
    Deprecated.
    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:

    field:KEY_ACTION_RELEASE [NONE]

    KEY_ACTION_RELEASE

    public static final  int KEY_ACTION_RELEASE
    Deprecated.
    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:

    field:MOUSE_DOWN [NONE]

    MOUSE_DOWN

    public static final  int MOUSE_DOWN
    Deprecated.
    The user has pressed the mouse button. The ALT_MASK flag indicates that the middle button has been pressed. The META_MASK flag indicates that the right button has been pressed.
    See Also:

    field:MOUSE_UP [NONE]

    MOUSE_UP

    public static final  int MOUSE_UP
    Deprecated.
    The user has released the mouse button. The ALT_MASK flag indicates that the middle button has been released. The META_MASK flag indicates that the right button has been released.
    See Also:

    field:MOUSE_MOVE [NONE]

    MOUSE_MOVE

    public static final  int MOUSE_MOVE
    Deprecated.
    The mouse has moved with no button pressed.
    See Also:

    field:MOUSE_ENTER [NONE]

    MOUSE_ENTER

    public static final  int MOUSE_ENTER
    Deprecated.
    The mouse has entered a component.
    See Also:

    field:MOUSE_EXIT [NONE]

    MOUSE_EXIT

    public static final  int MOUSE_EXIT
    Deprecated.
    The mouse has exited a component.
    See Also:

    field:MOUSE_DRAG [NONE]

    MOUSE_DRAG

    public static final  int MOUSE_DRAG
    Deprecated.
    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:

    field:SCROLL_LINE_UP [NONE]

    SCROLL_LINE_UP

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

    field:SCROLL_LINE_DOWN [NONE]

    SCROLL_LINE_DOWN

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

    field:SCROLL_PAGE_UP [NONE]

    SCROLL_PAGE_UP

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

    field:SCROLL_PAGE_DOWN [NONE]

    SCROLL_PAGE_DOWN

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

    field:SCROLL_ABSOLUTE [NONE]

    SCROLL_ABSOLUTE

    public static final  int SCROLL_ABSOLUTE
    Deprecated.
    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:

    field:SCROLL_BEGIN [NONE]

    SCROLL_BEGIN

    public static final  int SCROLL_BEGIN
    Deprecated.
    The scroll begin event.
    See Also:

    field:SCROLL_END [NONE]

    SCROLL_END

    public static final  int SCROLL_END
    Deprecated.
    The scroll end event.
    See Also:

    field:LIST_SELECT [NONE]

    LIST_SELECT

    public static final  int LIST_SELECT
    Deprecated.
    An item in a list has been selected.
    See Also:

    field:LIST_DESELECT [NONE]

    LIST_DESELECT

    public static final  int LIST_DESELECT
    Deprecated.
    An item in a list has been deselected.
    See Also:

    field:ACTION_EVENT [NONE]

    ACTION_EVENT

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

    field:LOAD_FILE [NONE]

    LOAD_FILE

    public static final  int LOAD_FILE
    Deprecated.
    A file loading event.
    See Also:

    field:SAVE_FILE [NONE]

    SAVE_FILE

    public static final  int SAVE_FILE
    Deprecated.
    A file saving event.
    See Also:

    field:GOT_FOCUS [NONE]

    GOT_FOCUS

    public static final  int GOT_FOCUS
    Deprecated.
    A component gained the focus.
    See Also:

    field:LOST_FOCUS [NONE]

    LOST_FOCUS

    public static final  int LOST_FOCUS
    Deprecated.
    A component lost the focus.
    See Also:

    field:target [NONE]

    target

    public Object target
    Deprecated.
    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:

    field:when [NONE]

    when

    public long when
    Deprecated.
    The time stamp. Replaced by InputEvent.getWhen().
    See Also:

    field:id [NONE]

    id

    public int id
    Deprecated.
    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:

    field:x [NONE]

    x

    public int x
    Deprecated.
    The x coordinate of the event. Replaced by MouseEvent.getX()
    See Also:

    field:y [NONE]

    y

    public int y
    Deprecated.
    The y coordinate of the event. Replaced by MouseEvent.getY()
    See Also:

    field:key [NONE]

    key

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

    field:modifiers [NONE]

    modifiers

    public int modifiers
    Deprecated.
    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:

    field:clickCount [NONE]

    clickCount

    public int clickCount
    Deprecated.
    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:

    field:arg [NONE]

    arg

    public Object arg
    Deprecated.
    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.

    field:evt [NONE]

    evt

    public Event evt
    Deprecated.
    The next event. This field is set when putting events into a linked list. This has been replaced by EventQueue.
    See Also:

    constructor:Event(java.lang.Object,long,int,int,int,int,int,java.lang.Object) [NONE]

  • Event

    public Event (Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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.
  • constructor:Event(java.lang.Object,long,int,int,int,int,int) [NONE]

    Event

    public Event (Object target, long when, int id, int x, int y, int key, int modifiers)
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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.

    constructor:Event(java.lang.Object,int,java.lang.Object) [NONE]

    Event

    public Event (Object target, int id, Object arg)
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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:translate(int,int) [NONE]

  • translate

    public void translate (int dx, int dy)
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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.
  • method:shiftDown() [NONE]

    shiftDown

    public boolean shiftDown()
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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:

    method:controlDown() [NONE]

    controlDown

    public boolean controlDown()
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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:

    method:metaDown() [NONE]

    metaDown

    public boolean metaDown()
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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:

    method:paramString() [NONE]

    paramString

    protected String paramString()
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. 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

    method:toString() [NONE]

    toString

    public String toString()
    Deprecated.
    NOTE: The Event class is obsolete and is available only for backwards compatibility. It has been replaced by the AWTEvent class and its subclasses.

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

    Overrides:
    toString in class Object
    Returns:
    a string that represents the event and the values of its member fields.
    Since:
    1.1
    See Also:

    © 2023 Oracle Corporation and/or its affiliates