Java Reference
In-Depth Information
The MouseListener interface
Defines methods to respond to events arising when the mouse cursor is moved into or out of the area
occupied by a component or one of the mouse buttons is pressed, released, or clicked.
Defined Methods
Description
mouseClicked(MouseEvent e)
Called when a mouse button is clicked on a
component - that is, when the button is pressed and
released.
mousePressed(MouseEvent e)
Called when a mouse button is pressed on a
component.
mouseReleased(MouseEvent e)
Called when a mouse button is released on a
component.
mouseEntered(MouseEvent e)
Called when the mouse enters the area occupied by
a component.
mouseExited(MouseEvent e)
Called when the mouse exits the area occupied by a
component.
The MouseMotionListener interface
Defines methods that are called when the mouse is moved or dragged with a button pressed.
Defined Methods
Description
mouseMoved(MouseEvent e)
Called when the mouse is moved within a
component.
mouseDragged(MouseEvent e)
Called when the mouse is moved within a
component while a mouse button is held down.
The MouseWheelListener interface
Defines a method to respond to the mouse wheel being rotated. This is frequently used to scroll
information that is displayed, but you can use it in any way that you want.
Defined Methods
Description
mouseWheelMoved(
MouseWheelEvent e)
Called when the mouse wheel is rotated.
Search WWH ::




Custom Search