Java MouseListener Interface
The Java MouseListener is notified whenever you change the state of mouse. It is notified against MouseEvent. The MouseListener interface is found in java.awt.event package. It has five methods.
Methods of MouseListener interface
The signature of 5 methods found in MouseListener interface are given below:
Java MouseListener Example
Output:
Java MouseListener Example 2
Output:
ava 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:
Java MouseMotionListener Example
Output:
Java MouseMotionListener Example 2
Output:
Comments
Post a Comment