|
Java™ by example!
|
|
|
How do I catch an event when the mouse moves over my JLabel?
You can add a MouseMotionListener for mouse movements or a MouseListener for other interesting mouse events. This example shows how to invert the color of the JLabel when the mouse is positioned over it. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|