My Mouse Example
by Michael Thomas
(Tutorial Home Page)
- See the use of Mouse Events.
- Implements MouseListener ( mouseClicked(), mouseEntered(), mouseExited(),
mousePressed(), & mouseReleased() )
- Implements MouseMotionListener ( mouseDragged(), mouseMoved() )
- Determine what mouse button & and key (Shift, Alt, Ctrl) was depressed.
- Note: MouseListener adapter is MouseAdapter
- Note: MouseMotionListener adapter is MouseMotionAdapter
Instructions:
Move your mouse into the applet area. Now try clicking (single & double),
dragging, and using the shift/alt/ctrl along with the mouse buttons. Next, view the
source code and LEARN.
The source