java.awt.event
Class MouseMotionAdapter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.event.MouseMotionAdapter
All Implemented Interfaces:
MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener , EventListener sample code for java.util.EventListener definition code for java.util.EventListener
Direct Known Subclasses:
BasicComboPopup.InvocationMouseMotionHandler sample code for javax.swing.plaf.basic.BasicComboPopup.InvocationMouseMotionHandler definition code for javax.swing.plaf.basic.BasicComboPopup.InvocationMouseMotionHandler , BasicComboPopup.ListMouseMotionHandler sample code for javax.swing.plaf.basic.BasicComboPopup.ListMouseMotionHandler definition code for javax.swing.plaf.basic.BasicComboPopup.ListMouseMotionHandler

public abstract class MouseMotionAdapter
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener

An abstract adapter class for receiving mouse motion events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Mouse motion events occur when a mouse is moved or dragged. (Many such events will be generated in a normal program. To track clicks and other mouse events, use the MouseAdapter.)

Extend this class to create a MouseEvent listener and override the methods for the events of interest. (If you implement the MouseMotionListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)

Create a listener object using the extended class and then register it with a component using the component's addMouseMotionListener method. When the mouse is moved or dragged, the relevant method in the listener object is invoked and the MouseEvent is passed to it.

Since:
1.1
See Also:
MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent , MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener , Tutorial: Writing a Mouse Motion Listener, Reference: The Java Class Libraries (update file)

Constructor Summary
MouseMotionAdapter sample code for java.awt.event.MouseMotionAdapter.MouseMotionAdapter() definition code for java.awt.event.MouseMotionAdapter.MouseMotionAdapter() ()
           
 
Method Summary
 void mouseDragged sample code for java.awt.event.MouseMotionAdapter.mouseDragged(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionAdapter.mouseDragged(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseMoved sample code for java.awt.event.MouseMotionAdapter.mouseMoved(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionAdapter.mouseMoved(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse button has been moved on a component (with no buttons no down).
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

MouseMotionAdapter sample code for java.awt.event.MouseMotionAdapter() definition code for java.awt.event.MouseMotionAdapter()

public MouseMotionAdapter()
Method Detail

mouseDragged sample code for java.awt.event.MouseMotionAdapter.mouseDragged(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionAdapter.mouseDragged(java.awt.event.MouseEvent)

public void mouseDragged(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Specified by:
mouseDragged sample code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) in interface MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener

mouseMoved sample code for java.awt.event.MouseMotionAdapter.mouseMoved(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionAdapter.mouseMoved(java.awt.event.MouseEvent)

public void mouseMoved(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when the mouse button has been moved on a component (with no buttons no down).

Specified by:
mouseMoved sample code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent) in interface MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener