The MouseMotionListener Interface : MouseMotionListener « Swing Event « Java Tutorial






This interface defines methods that are called when the mouse is moved or dragged with a button pressed.

Defined MethodsDescription
mouseMoved(MouseEvent e)Called when the mouse is moved within a component
mouseDragged(MouseEvent e)Called when the mouse is moved within a component while a mouse button is held down


15.30.MouseMotionListener
15.30.1.The MouseMotionListener Interface
15.30.2.Demonstrates mouse motion eventsDemonstrates mouse motion events
15.30.3.How to Write a Mouse-Motion ListenerHow to Write a Mouse-Motion Listener
15.30.4.Handle mouse motion event