-
Managing swing thread priorities
Hello,
I'm coding a Swing application that has a huge component being redrawn every few seconds, and I'd like to display a small progress dialog on top of it, to allow the user to know what's going on and maybe cancel the drawing. It's working most of the time, but sometimes the component being drawn in the main window takes too much time to draw so that the small dialog becomes unresponsive and doesn't update. I'd like to make the main drawing thread have a lower priority, but I've tried invoking Thread.currentThread().setPriority(Thread.MIN_PRIORITY) inside the paintComponent() method, and it didn't work. I believe it is due to the fact that both components are being drawn by the same thread, since Swing is monothreaded. In this case, how could I do it? Creating a SwingWorker thread to render the large component somewhere else, and only then updating? Or is there a simpler way of doing it?
Similar Threads
-
By Shazzle in forum Careers
Replies: 0
Last Post: 02-23-2007, 04:24 PM
-
By manik_gopal in forum Java
Replies: 4
Last Post: 04-27-2006, 07:01 AM
-
By Darren Bell in forum Talk to the Editors
Replies: 2
Last Post: 09-20-2002, 10:32 AM
-
Replies: 1
Last Post: 10-29-2000, 04:51 PM
-
Replies: 2
Last Post: 10-27-2000, 03:07 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks