Article View: borland.public.jbuilder.java.swing
Article #11799Re: JProgressBar???
From: Frank Packenham
Date: Fri, 26 Mar 1999 00:00
Date: Fri, 26 Mar 1999 00:00
34 lines
2148 bytes
2148 bytes
Tad Frysinger <tfrysinger@earthlink.net> wrote in message news:MPG.116405e456424a169899a8@forums.borland.com... >In article <36D28D4D.4F81E9D2@teamworks.de>, mschmitz@teamworks.de >says... >> hi, >> >> you should read the swing documentation carefully!!!!!!!!! >> >> the progressbar can't be updated, because you're doing all the work >> inside the event-dispatching thread. that means the messages for >> repaint,validate a.s.o. don't get processed until your method finishes! >> the only save and clean solution is to use a thread to do all your >> processing (try the worker class available at java.sun.com) and call the >> progressbar.setValue method from this thread! >> martin >> >Just saw your example - this is also *not* what you are supposed to do. >Make sure that you update the progress bar from your second thread so >that it places the update request in the event thread's queue. Check out >the SwingUtilities.invokeLater() method. > >Otherwise, another window (or some other [paint event) will end up >deadlocking you. > >Tad Frysinger >[TeamB] I've looked at that piece and am now confused. do I call invokeLater on the second thread, or from the second thread. If the latter, then what am I calling invokeLater on?? ------- Frank Packenham Senior Analyst/Developer NeuroFlex Pty Ltd.
Technical Details
Message-ID:
<7der3h$rt89@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7asa65$s6f3@forums.borland.com> <36D1B06A.32258010@netrisk.com> <7asbfp$s6c8@forums.borland.com> <7atidp$1785@forums.borland.com> <36D28D4D.4F81E9D2@teamworks.de> <MPG.116405e456424a169899a8@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c7a418e2d93c1eb4 X-Google-Attributes: gid111d45,public From: "Frank Packenham" <frank@NeuroFlex.com> Subject: Re: JProgressBar??? Date: 1999/03/26 Message-ID: <7der3h$rt89@forums.borland.com> X-Deja-AN: 459188092 Content-Transfer-Encoding: 7bit References: <7asa65$s6f3@forums.borland.com> <36D1B06A.32258010@netrisk.com> <7asbfp$s6c8@forums.borland.com> <7atidp$1785@forums.borland.com> <36D28D4D.4F81E9D2@teamworks.de> <MPG.116405e456424a169899a8@forums.borland.com> Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal X-Priority: 3 Content-Type: text/plain; charset="iso-8859-1" Mime-Version: 1.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Newsgroups: borland.public.jbuilder.java.swing