Java java.awt.event MouseEvent fields, constructors, methods, implement or subclass

Example usage for Java java.awt.event MouseEvent fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt.event MouseEvent.

The text is from its open source code.

Field

intMOUSE_CLICKED
The "mouse clicked" event.
intMOUSE_PRESSED
The "mouse pressed" event.
intMOUSE_RELEASED
The "mouse released" event.
intMOUSE_MOVED
The "mouse moved" event.
intMOUSE_ENTERED
The "mouse entered" event.
intMOUSE_EXITED
The "mouse exited" event.
intMOUSE_DRAGGED
The "mouse dragged" event.
intMOUSE_WHEEL
The "mouse wheel" event.
intNOBUTTON
Indicates no mouse buttons; used by #getButton .
intBUTTON1
Indicates mouse button #1; used by #getButton .
intBUTTON2
Indicates mouse button #2; used by #getButton .
intBUTTON3
Indicates mouse button #3; used by #getButton .

Constructor

MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int button)
Constructs a MouseEvent object with the specified source component, type, time, modifiers, coordinates, absolute coordinates, click count, popupTrigger flag, and button number.
MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger)
Constructs a MouseEvent object with the specified source component, type, modifiers, coordinates, click count, and popupTrigger flag.
MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button)
Constructs a MouseEvent object with the specified source component, type, time, modifiers, coordinates, click count, popupTrigger flag, and button number.

Method

voidconsume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.
intgetButton()
Returns which, if any, of the mouse buttons has changed state.
intgetClickCount()
Returns the number of mouse clicks associated with this event.
ComponentgetComponent()
Returns the originator of the event.
intgetID()
Returns the event type.
PointgetLocationOnScreen()
Returns the absolute x, y position of the event.
intgetModifiers()
Returns the modifier mask for this event.
intgetModifiersEx()
StringgetMouseModifiersText(int modifiers)
Returns a String instance describing the modifier keys and mouse buttons that were down during the event, such as "Shift", or "Ctrl+Shift".
PointgetPoint()
Returns the x,y position of the event relative to the source component.
ObjectgetSource()
The object on which the Event initially occurred.
longgetWhen()
Returns the difference in milliseconds between the timestamp of when this event occurred and midnight, January 1, 1970 UTC.
intgetX()
Returns the horizontal x position of the event relative to the source component.
intgetXOnScreen()
Returns the absolute horizontal x position of the event.
intgetY()
Returns the vertical y position of the event relative to the source component.
intgetYOnScreen()
Returns the absolute vertical y position of the event.
inthashCode()
Returns a hash code value for the object.
booleanisAltDown()
Returns whether or not the Alt modifier is down on this event.
booleanisConsumed()
Returns whether or not this event has been consumed.
booleanisControlDown()
Returns whether or not the Control modifier is down on this event.
booleanisMetaDown()
Returns whether or not the Meta modifier is down on this event.
booleanisPopupTrigger()
Returns whether or not this mouse event is the popup menu trigger event for the platform.
booleanisShiftDown()
Returns whether or not the Shift modifier is down on this event.
StringparamString()
Returns a parameter string identifying this event.
StringtoString()
Returns a String representation of this object.
voidtranslatePoint(int x, int y)
Translates the event's coordinates to a new position by adding specified x (horizontal) and y (vertical) offsets.