How can I update a GUI component immediately during a long-running operation?

Sandip Chitale

AWT/Swing does its repaints only on what are called AWT threads. Therefore you should do the long running processing on background thread (not the thread on which you are handling callbacks from AWT/Swing controls). That way the control goes to AWT thread quickly and is able to refresh update the display. On a preemtive multitasking threading model JVMs you won't even need to mess with the priority.

Please see the following articles for details

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact