[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-devel
Subject:    Re: [ jEdit-devel ] What should go on the Swing thread?
From:       Slava Pestov <slava () jedit ! org>
Date:       2004-07-21 18:35:09
Message-ID: 40FEB75D.2050407 () jedit ! org
[Download RAW message or body]

Hi,

This is documented in the Swing API documentation.

Patrick Wright wrote:
> I have been working on a plugin that loads a JTree with some file lists
> based on search criteria, and the search can take a little while to
> process.
> 
> My question is, if I run the search in a background thread, and then want
> to update the TreeModel (either by adding individual nodes, or a new model
> entirely), should the update to the TreeModel go on the Swing event thread
> with invokeLater() or not?
> 
> What I am wondering is about the common knowledge that Swing components
> should only be modified on the Swing event processing thread. I think this
> definitely applies to things like add(component), but not sure about
> things like setModel(), adding or removing listeners, etc.--all at least
> setModel() can in turn generate messages for the GUI to update, but those
> would be asynchronous, wouldn't they, processed through the event queue?
> 
> Confused.
> 
> TIA
> Patrick
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_idG21&alloc_id040&op=click



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic