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

Print this page




  30 /**
  31  * The listener interface for receiving mouse motion events on a component.
  32  * (For clicks and other mouse events, use the <code>MouseListener</code>.)
  33  * <P>
  34  * The class that is interested in processing a mouse motion event
  35  * either implements this interface (and all the methods it
  36  * contains) or extends the abstract <code>MouseMotionAdapter</code> class
  37  * (overriding only the methods of interest).
  38  * <P>
  39  * The listener object created from that class is then registered with a
  40  * component using the component's <code>addMouseMotionListener</code>
  41  * method. A mouse motion event is generated when the mouse is moved
  42  * or dragged. (Many such events will be generated). When a mouse motion event
  43  * occurs, the relevant method in the listener object is invoked, and
  44  * the <code>MouseEvent</code> is passed to it.
  45  *
  46  * @author Amy Fowler
  47  *
  48  * @see MouseMotionAdapter
  49  * @see MouseEvent
  50  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
  51  *
  52  * @since 1.1
  53  */
  54 public interface MouseMotionListener extends EventListener {
  55 
  56     /**
  57      * Invoked when a mouse button is pressed on a component and then
  58      * dragged.  <code>MOUSE_DRAGGED</code> events will continue to be
  59      * delivered to the component where the drag originated until the
  60      * mouse button is released (regardless of whether the mouse position
  61      * is within the bounds of the component).
  62      * <p>
  63      * Due to platform-dependent Drag&Drop implementations,
  64      * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
  65      * Drag&Drop operation.
  66      */
  67     public void mouseDragged(MouseEvent e);
  68 
  69     /**
  70      * Invoked when the mouse cursor has been moved onto a component


  30 /**
  31  * The listener interface for receiving mouse motion events on a component.
  32  * (For clicks and other mouse events, use the <code>MouseListener</code>.)
  33  * <P>
  34  * The class that is interested in processing a mouse motion event
  35  * either implements this interface (and all the methods it
  36  * contains) or extends the abstract <code>MouseMotionAdapter</code> class
  37  * (overriding only the methods of interest).
  38  * <P>
  39  * The listener object created from that class is then registered with a
  40  * component using the component's <code>addMouseMotionListener</code>
  41  * method. A mouse motion event is generated when the mouse is moved
  42  * or dragged. (Many such events will be generated). When a mouse motion event
  43  * occurs, the relevant method in the listener object is invoked, and
  44  * the <code>MouseEvent</code> is passed to it.
  45  *
  46  * @author Amy Fowler
  47  *
  48  * @see MouseMotionAdapter
  49  * @see MouseEvent
  50  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
  51  *
  52  * @since 1.1
  53  */
  54 public interface MouseMotionListener extends EventListener {
  55 
  56     /**
  57      * Invoked when a mouse button is pressed on a component and then
  58      * dragged.  <code>MOUSE_DRAGGED</code> events will continue to be
  59      * delivered to the component where the drag originated until the
  60      * mouse button is released (regardless of whether the mouse position
  61      * is within the bounds of the component).
  62      * <p>
  63      * Due to platform-dependent Drag&Drop implementations,
  64      * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
  65      * Drag&Drop operation.
  66      */
  67     public void mouseDragged(MouseEvent e);
  68 
  69     /**
  70      * Invoked when the mouse cursor has been moved onto a component