Article View: borland.public.jbuilder.java.swing
Article #11853Re: JProgressBar problems
From: Carlos Javier Castro Pena
Date: Tue, 06 Apr 1999 00:00
Date: Tue, 06 Apr 1999 00:00
41 lines
2026 bytes
2026 bytes
You may need to use another thread. When the main (?) thread is doing
something, such as downloading data from a database, the repaint()
methods are delayed until the download is finished. You can obtain more
detailed information in the swing news group or in the java tutorial
(java.sun.com)
Jan Lacluyse wrote:
> i have some problems with the JProcessBar class !!
>
> When i want to change the value of a JProgressBar (setValue(int)) in a
> MouseListener method from a Button, it doesn't change immediately.
> It only change when all the functions are done in the MouseListener
> method, even i call the method repaint() after setting a new value
> and sets the minimum- and maximum value correctly.
>
> Example :
>
> void startButton_mouseClicked(MouseEvent e) {
> startButton.disable(); // property immediately
> changed
> aProgressBar.setMinimum(0);
> aProgressBar.setMaximum(100);
> for (int i=0 ; i<100 ; i++) {
> aProgressBar.setValue(i); // property not changed
> aProgressBar.repaint(); // property not changed
> }
> startButton.enabled(); // property immediately
> changed
> }
> // after this method the value of the ProgressBar will be 100
> (getValue()) and only will be repaint after this method !!!
>
>
> Can someone give me a solution !!!
>
> greetings Jan
>
> please reply at :
> jan.lacluyse@teleatlas.com
>
Technical Details
Message-ID:
<370A462F.EB3206EB@ittc.ukans.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<370A0358.433014F1@teleatlas.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,80ff9302a50d2f4b X-Google-Attributes: gid111d45,public From: Carlos Javier Castro Pena <jcaspen@ittc.ukans.edu> Subject: Re: JProgressBar problems Date: 1999/04/06 Message-ID: <370A462F.EB3206EB@ittc.ukans.edu> X-Deja-AN: 463313510 Content-Transfer-Encoding: 7bit References: <370A0358.433014F1@teleatlas.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ITTC - University Of Kansas Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing