πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11013

Re: Beginner question: how can I get a ProgressBar to refresh ?

#11013
From: Yannick.Bollati
Date: Sun, 18 Jul 1999 00:00
30 lines
1351 bytes
That's right, if I use a different thread, it woks...

Thanks.

Yannick.

Matt Krevs a οΏ½crit dans le message <7mgfqp$18d9@forums.borland.com>...
>I'm no expert but..
>
>I think the problem is that you are trying to update the progress bar in
the
>event dispatching thread. Basically the update wont happen until your for
>loop finishes.
>
>The way (I think) JProgressBar was meant to be used was to give an update
of
>the status of a piece of work running within another thread.
>
>eg
>open frame
>display progress bar
>spawn a new thread that does some work
>
>in the new thread...
>
>for loop {
>    do some work
>    SwingUtlilites.invokeLater ( progressBar.setValue(whatever) )
>}
>
Technical Details
Message-ID: <7mtej0$dl01@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7mg1po$t311@forums.borland.com> <7mg3i1$tm16@forums.borland.com> <7mg7fi$t615@forums.borland.com> <7mgfqp$18d9@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,3a34dcd158442895
X-Google-Attributes: gid111d45,public
From: "Yannick.Bollati" <Yannick.Bollati@wanadoo.fr>
Subject: Re: Beginner question: how can I get a ProgressBar to refresh ?
Date: 1999/07/18
Message-ID: <7mtej0$dl01@forums.borland.com>
X-Deja-AN: 502488113
References: <7mg1po$t311@forums.borland.com> <7mg3i1$tm16@forums.borland.com> <7mg7fi$t615@forums.borland.com> <7mgfqp$18d9@forums.borland.com>
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Newsgroups: borland.public.jbuilder.java.swing