Article View: borland.public.jbuilder.java.swing
Article #11797Re: JProgressBar???
From: Tad Frysinger
Date: Thu, 25 Mar 1999 00:00
Date: Thu, 25 Mar 1999 00:00
24 lines
1521 bytes
1521 bytes
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]
Technical Details
Message-ID:
<MPG.116405e456424a169899a8@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>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c7a418e2d93c1eb4 X-Google-Attributes: gid111d45,public From: tfrysinger@earthlink.net (Tad Frysinger) Subject: Re: JProgressBar??? Date: 1999/03/25 Message-ID: <MPG.116405e456424a169899a8@forums.borland.com> X-Deja-AN: 458984201 References: <7asa65$s6f3@forums.borland.com> <36D1B06A.32258010@netrisk.com> <7asbfp$s6c8@forums.borland.com> <7atidp$1785@forums.borland.com> <36D28D4D.4F81E9D2@teamworks.de> Organization: Freezone Enterprises Newsgroups: borland.public.jbuilder.java.swing