Thanks for clearing that up Thomas. vyang
thomas.deweese wrote: > > Hi VYang, > > vyang <[email protected]> wrote on 09/02/2009 10:01:26 AM: > >> Now with my code below, I'm just wondering if its a good idea/good > coding to >> put updatemanager runnables inside a swing worker. > > It's fine to have runnables in the swing thread, > but you can't wait for them. The problem is that occasionally > the rendering engine needs to get information from Swing, it can > only do that safely in the Swing thread, so if the swing thread is > waiting for a runnable to complete and that runnable is waiting for > the swing thread to become available you get a deadlock. > >> The swingworker is used to display an progress bar only (I believe). >> I've read somewhere that the progress bar should be run under >> swingutilities runnable. > > Right updates to swing components must be done in the Swing thread. > I would suggest that you submit a runnable to the swing thread to update > the progressbar when your runnable in the UpdateManager thread completed. > >> vyang wrote: >> > >> > SwingWorker worker = new SwingWorker(){ >> > public Object construct() { >> > try { >> > >> > finalDrawingPanel.getUpdateManager().getUpdateRunnableQueue(). >> invokeAndWait(new >> > Runnable(){ > > Here is the problem you can't wait on UpdateManager runnables > from the Swing Thread. > > -- View this message in context: http://www.nabble.com/Update-Manager-Failing-tp25081949p25278040.html Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
