jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Change the mouse cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change the mouse cursor" Watch "Change the mouse cursor" New topic
Author

Change the mouse cursor

Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Hi,

How can I change the default mouse cursor when my cursor moves over a JLabel and change it back to the default when it moves away from the JLabel?

Thanx


There is no patch for ignorance...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20049
    
  30

Component has a setCursor method which takes a Cursor object. You can create Cursor objects using the constants in Cursor, such as Cursor.HAND_CURSOR.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Thanx Rob !
 
Don't get me started about those stupid light bulbs.
 
subject: Change the mouse cursor
 
It's not a secret anymore!