File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Need help with wait cursor and setEnable( false ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need help with wait cursor and setEnable( false )" Watch "Need help with wait cursor and setEnable( false )" New topic

Need help with wait cursor and setEnable( false )

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Hi guys,

Please help me with an issue I have. I have a button and when user click it, it does some calculation in another thread and I am doing fine on that part. But I want the cursor to change to hour glass and also setEnable( false ). I don't know why but when I first click the button, the cursor is changed to hour glass but as soon as I move the mouse, it change back to the default. My component on the screen will not be enable until the other thread has finish the calculation. Here is the code

what I really confused about is when I comment out

the cursor will stay as hour glass and will not change back until the calculation has completed. but this is not desireable because even if the cursor is hour glass, the user can still click a button and leave the screen before the calculation has completed. Please help me if you have any experience with issue before.

Thank you
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1075

Your call to set the cursor is correct.
But, the following line should be changed
Davie Lin wrote:


I agree. Here's the link:
subject: Need help with wait cursor and setEnable( false )
Similar Threads
strange thread probs
threading issue
Change the mouse cursor to hourglass
What is the expected behaviour of the cursor when a dialog appears?
Change cursor