Java MouseMotionListener Interface

The Java MouseMotionListener is notified whenever you move or drag mouse. It is notified against MouseEvent. The MouseMotionListener interface is found in java.awt.event package. It has two methods.

Methods of MouseMotionListener interface

The signature of 2 methods found in MouseMotionListener interface are given below:

public abstract void mouseDragged(MouseEvent e);

public abstract void mouseMoved(MouseEvent e);


Java MouseMotionListener Example

Flash Soon


Output:

Java MouseMotionListener Example 2

Flash Soon


Output:


Advertisement

© Sapster 2017