The MouseAdapter class implements the methods of MouseListener with empty functions. It may be easier for you to extend MouseAdapter, overriding only those methods you are interested in, than to implement MouseListener and provide the empty functions yourself.
public abstract class java.awt.event.MouseAdapter extends java.lang.Object implements java.awt.event.MouseListener { // Instance Methods public void mouseClicked (MouseEvent e); public void mouseEntered (MouseEvent e); public void mouseExited (MouseEvent e); public void mousePressed (MouseEvent e); public void mouseReleased (MouseEvent e); }
The event that has occurred.
Does nothing. Override this function to be notified when the mouse button is clicked (pressed and released).
The event that has occurred.
Does nothing. Override this function to be notified when the user moves the mouse cursor into a component.
The event that has occurred.
Does nothing. Override this function to be notified when the moves the mouse cursor out of a component.
The event that has occurred.
Does nothing. Override this function to be notified when the mouse button is pressed.
The event that has occurred.
Does nothing. Override this function to be notified when the mouse button is released.
MouseEvent, MouseListener