Abstract Class MouseMotionAdapter in Java

The MouseMotionAdapter class implements the methods of MouseMotionListener with empty functions. It may be easier for us to extend MouseMotionAdapter, overriding only those methods we are interested in than to implement MouseMotionListener and provide the empty functions ourselves.

The structure of the abstract class MouseMotionAdapter is given by

public abstract class java.awt.event.MouseMotionAdapter
extends java.lang.Object
implements java.awt.event.MouseMotionListener {
// Instance Methods
public void mouseDragged(MouseEvent e);
public void mouseMoved(MouseEvent e);
}

The details of the class structure are given as follows:

public void mouseDragged(MouseEvent e);

public void mouseDragged(MouseEvent e) method actually does nothing. We need to override this function to be notified when the mouse is dragged.

Parameter
e – The event that has occurred.

public void mouseMoved(MouseEvent e);

public void mouseMoved(MouseEvent e) method actually does nothing. We need to override this function to be notified when the mouse moves.

Parameter
e – The event that has occurred.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on [email protected]

Write A Comment