src/share/classes/java/awt/event/MouseAdapter.java

Print this page




  46  * Create a listener object using the extended class and then register it with
  47  * a component using the component's {@code addMouseListener}
  48  * {@code addMouseMotionListener}, {@code addMouseWheelListener}
  49  * methods.
  50  * The relevant method in the listener object is invoked  and the {@code MouseEvent}
  51  * or {@code MouseWheelEvent}  is passed to it in following cases:
  52  * <ul>
  53  * <li>when a mouse button is pressed, released, or clicked (pressed and  released)
  54  * <li>when the mouse cursor enters or exits the component
  55  * <li>when the mouse wheel rotated, or mouse moved or dragged
  56  * </ul>
  57  *
  58  * @author Carl Quinn
  59  * @author Andrei Dmitriev
  60  *
  61  * @see MouseEvent
  62  * @see MouseWheelEvent
  63  * @see MouseListener
  64  * @see MouseMotionListener
  65  * @see MouseWheelListener
  66  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  67  *
  68  * @since 1.1
  69  */
  70 public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
  71     /**
  72      * {@inheritDoc}
  73      */
  74     public void mouseClicked(MouseEvent e) {}
  75 
  76     /**
  77      * {@inheritDoc}
  78      */
  79     public void mousePressed(MouseEvent e) {}
  80 
  81     /**
  82      * {@inheritDoc}
  83      */
  84     public void mouseReleased(MouseEvent e) {}
  85 
  86     /**




  46  * Create a listener object using the extended class and then register it with
  47  * a component using the component's {@code addMouseListener}
  48  * {@code addMouseMotionListener}, {@code addMouseWheelListener}
  49  * methods.
  50  * The relevant method in the listener object is invoked  and the {@code MouseEvent}
  51  * or {@code MouseWheelEvent}  is passed to it in following cases:
  52  * <ul>
  53  * <li>when a mouse button is pressed, released, or clicked (pressed and  released)
  54  * <li>when the mouse cursor enters or exits the component
  55  * <li>when the mouse wheel rotated, or mouse moved or dragged
  56  * </ul>
  57  *
  58  * @author Carl Quinn
  59  * @author Andrei Dmitriev
  60  *
  61  * @see MouseEvent
  62  * @see MouseWheelEvent
  63  * @see MouseListener
  64  * @see MouseMotionListener
  65  * @see MouseWheelListener
  66  * @see <a href="https://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  67  *
  68  * @since 1.1
  69  */
  70 public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
  71     /**
  72      * {@inheritDoc}
  73      */
  74     public void mouseClicked(MouseEvent e) {}
  75 
  76     /**
  77      * {@inheritDoc}
  78      */
  79     public void mousePressed(MouseEvent e) {}
  80 
  81     /**
  82      * {@inheritDoc}
  83      */
  84     public void mouseReleased(MouseEvent e) {}
  85 
  86     /**