Article View: borland.public.jbuilder.java.swing
Article #12096Re: JProgressBar???
From: Martin Schmitz
Date: Tue, 23 Feb 1999 00:00
Date: Tue, 23 Feb 1999 00:00
50 lines
2209 bytes
2209 bytes
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 Dieter Mach wrote: > > Hi, > > we also had serious problems with updat๏ฟฝng a progress bar. We found this > working: > > progressBar.paintImmediately(progressBar.getBounds()); > > I don't know wether this will work in your app also, because from the code > snipplet I can't see how you add the progress bar to your dialog or panel. I > think it woud be a good idea not to create a new JProgressBar every time > before passing the setValue() method. Also, don't forget to call something > like > > progressBar.setMinimum(0); > progressBar.setMaximum(100); > > before using the progress bar. > > Dieter > > Marcel Hell schrieb in Nachricht <7asbfp$s6c8@forums.borland.com>... > > > >Vasudevan Srinivasan schrieb in Nachricht > <36D1B06A.32258010@netrisk.com>... > >>Hi, > >>Just a guess, try calling the jProgressBar1.repaint() or validate() or > >>similar-functioning methods immediately after jProgressBar1.setValue() > >> > >>Vasu > >> > >> > > > >I've also tried that, but nothing happens! > >I can't get it to be updated!!!! > > > >
Technical Details
Message-ID:
<36D28D4D.4F81E9D2@teamworks.de>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>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,c7a418e2d93c1eb4 X-Google-Attributes: gid111d45,public From: Martin Schmitz <mschmitz@teamworks.de> Subject: Re: JProgressBar??? Date: 1999/02/23 Message-ID: <36D28D4D.4F81E9D2@teamworks.de> X-Deja-AN: 447438866 Content-Transfer-Encoding: 8bit References: <7asa65$s6f3@forums.borland.com> <36D1B06A.32258010@netrisk.com> <7asbfp$s6c8@forums.borland.com> <7atidp$1785@forums.borland.com> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing