This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change the mouse cursor" Watch "Change the mouse cursor" New topic

Change the mouse cursor

Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45

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?


There is no patch for ignorance...
Rob Spoor

Joined: Oct 27, 2005
Posts: 19649

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.

How To Ask Questions How To Answer Questions
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Thanx Rob !
I agree. Here's the link:
subject: Change the mouse cursor
Similar Threads
Setting the cursor type in jtable.very urgent
setting mouse cursors to default in windows NT and Solaris
Help me to solve these problems in JEditorPane
Getting a JLabel to follow the cursor
How to do a Mouseover..