• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disable JFrame and change cursor icon

 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the user clicks the JButton a potentially long operation takes place so I want to disable all the components on the JFrame and also change the cursor icon to the hourglass. Now I have code to do either of them. However, once all the components are disabled I can't seem to get the cursor icon to stay the hourglass. Anyone have any ideas how I can do both?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are two good articles:

Customize SwingWorker to improve Swing GUIs(JavaWorld) - describes how to use SwingWorker to control long running tasks, last page of article talks about using SwingWorker and GlassPane together to consume any attempted actions on the frame while the long task is running.

Wait, Cursor, Wait! (JavaSpecialists Newsletter) - Describes a small toolkit and some "gotchas" with trying to implement a "global" wait cursor in an application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!