This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Setting cursor after a dialog closes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Setting cursor after a dialog closes" Watch "Setting cursor after a dialog closes" New topic
Author

Setting cursor after a dialog closes

Manuel Godbert
Greenhorn

Joined: Nov 23, 2004
Posts: 3
Hello,

I am experiencing problems trying to change the cursor.
My code first opens a JFrame, then a modal dialog is opened hiding a part of my JFrame and finally some long task is performed after the dialog closes.
I'd like to set a wait cursor on my JFrame before starting the long task but the modal dialog thing seems to stop it from working properly.
I know how I could process my long task in a separate thread or postpone my task in the Event Queue, but this heavy to code (my real long task can be interrupted many times by other dialog windows).

This is my test case:


Thanks to tell me if you know any workaround for my problem !
Manuel Godbert
Greenhorn

Joined: Nov 23, 2004
Posts: 3
Finally I found out the solution, setting the cursor on the glasspane of the frame instead of the frame itself.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Setting cursor after a dialog closes
 
Similar Threads
Maximize button in JDialog
SwingWorker and Modal JDialogs
Set Wait Cursor
Cursor handling in JTextArea
Modal dialog box and request focus