The MouseListener Interface : MouseListener « Swing Event « Java Tutorial






The MouseListener Interface: respond to events 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 MethodsDescription
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


15.29.MouseListener
15.29.1.The MouseListener Interface
15.29.2.MouseListener and MouseEvent
15.29.3.Drag and drop imageDrag and drop image