MouseEvent

Name

MouseEvent

[Graphic: Figure from the text]

Description

Mouse events are generated when the user moves and clicks the mouse.

Class Definition

public class java.awt.event.MouseEvent extends java.awt.event.InputEvent {
 // Constants public final static int MOUSE_CLICKED;
public final static int MOUSE_DRAGGED;
public final static int MOUSE_ENTERED;
public final static int MOUSE_EXITED;
public final static int MOUSE_FIRST;
public final static int MOUSE_LAST;
public final static int MOUSE_MOVED;
public final static int MOUSE_PRESSED;
public final static int MOUSE_RELEASED; // Constructors public MouseEvent (Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger); // Instance Methods public int getClickCount();
public synchronized Point getPoint();
public int getX();
public int getY();
public boolean isPopupTrigger();
public String paramString();
public synchronized void translatePoint (int x, int y);
}

Constants

MOUSE_CLICKED

public final static int MOUSE_CLICKED

An event type ID indicating a mouse click.

MOUSE_DRAGGED

public final static int MOUSE_DRAGGED

An event type ID indicating a mouse move with the button held down.

MOUSE_ENTERED

public final static int MOUSE_ENTERED

An event type ID indicating that a mouse entered a component.

MOUSE_EXITED

public final static int MOUSE_EXITED

An event type ID indicating that a mouse left a component.

MOUSE_FIRST

public final static int MOUSE_FIRST

Specifies the beginning range of mouse event ID values.

MOUSE_LAST

public final static int MOUSE_LAST

Specifies the ending range of mouse event ID values.

MOUSE_MOVED

public final static int MOUSE_MOVED

An event type ID indicating a mouse move.

MOUSE_PRESSED

public final static int MOUSE_PRESSED

An event type ID indicating a mouse button press.

MOUSE_RELEASED

public final static int MOUSE_RELEASED

An event type ID indicating a mouse button release.

Constructors

MouseEvent

public MouseEvent (Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger)

Instance Methods

getClickCount

public int getClickCount()

getPoint

public synchronized Point getPoint()

getX

public int getX()

getY

public int getY()

isPopupTrigger

public boolean isPopupTrigger()

paramString

public String paramString()

translatePoint

public synchronized void translatePoint (int x, int y)

See Also

Component, ComponentEvent, InputEvent, MouseAdapter, MouseListener, Point