Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3873

Re: Worker Threads and ED

From "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this>
Subject Re: Worker Threads and ED
Message-ID <hrGdnTFa6NyIoQnVnZ2dnUVZ8sXinZ2d@bt.com> (permalink)
Newsgroups comp.lang.java.gui
References <6ORkk.153731$gc5.37078@pd7urf2no>
Date 2011-04-27 15:47 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
i.dont.need@any.more.email wrote:
> Knute Johnson wrote:
>> i.dont.need@any.more.email wrote:
>>>
>>> I have some legacy code to spruce up, and it breaks one of the 
>>> cardinal rules of swing: it updates the UI with worker threads (not 
>>> the EDT). 
> 
>> If you want to trap calls to the paintComponent() method that aren't 
>> on the EDT, use EventQueue.isDispatchThread() and throw an exception 
>> if it is false.  The problem I see with that is that calls to methods 
>> that later call repaint() will not be found.
> 
> How do I inject this code into JComponent? There are thousands of swing 
> instances in the application which might be affected, I need to sort out 
> which ones actually are, then trace back to the problematic worker 
> thread and separate the background process from the UI.
> 

I use ThreadCheckingRepaintManager from
http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html

-- 
RGB

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Worker Threads and ED "i.dont.need" <i.dont.need@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Worker Threads and ED "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

csiph-web