🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JProgressBar how do you use it?

#10462
From: Rich Wilkman
Date: Fri, 01 Oct 1999 00:00
50 lines
2096 bytes
Shane:

Check the article on the Swing Connection on using the progressbar. 
Basically, you need to paint it on it's own thread.

-Rich

Shane Cooper wrote:
> 
> Hi,
> i am trying to use the jprogress bar to give status in downloading a file to
> the comm port.I get the pane to show with the progress bar in it but it
> doesnt update. the progressbar is contained in the progresspanel. here is
> the block of code that i am using to for the progressbar.
> 
>         int max_count = (int)f.length();
>         int count = 0;
>         progressPanel1.jProgressBar1.setMaximum(max_count);
>         progressPanel1.jProgressBar1.setMinimum(count);
> 
>         while((n = fis.available()) > 0) {
>           int result = fis.read();
>           if (result == -1) break;
>           connection.serialDataOut((char)result);
>           count++;
>           progressPanel1.jProgressBar1.setValue(count);
>         }
>         fis.close();
>         progressPanel1.setVisible(false);
> 
> Any help appreciated.
> 
> thanks
> 
> shane cooper

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Quality Assurance Manager
Borland JBuilder Team

If you see something that looks like an opinion up there,
it's mine and mine alone.

Mail sent to me from the newsgroups won't bounce but will
be ignored.  If I have time, I'll respond, but you  have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <37F4D375.2752BBF8@inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7t1rde$5aa7@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,55ba8bc5b7bbc80a
X-Google-Attributes: gid111d45,public
From: Rich Wilkman <rwilkman@inprise.com>
Subject: Re: JProgressBar how do you use it?
Date: 1999/10/01
Message-ID: <37F4D375.2752BBF8@inprise.com>
X-Deja-AN: 531579897
Content-Transfer-Encoding: 7bit
References: <7t1rde$5aa7@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing