🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JProgressBar problems

#11851
From: Jan Lacluyse
Date: Tue, 06 Apr 1999 00:00
78 lines
3884 bytes
--------------92893CCE57C8C1FD0B1BF9C2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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


--------------92893CCE57C8C1FD0B1BF9C2
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
i have some problems with the JProcessBar class !!
<p>When i want to change the value of a JProgressBar (<i><font size=-1>setValue(int)</font></i>)
in a MouseListener method from a Button, it doesn't change immediately.
<br>It only change when all the functions are done in the MouseListener
method, even i call the method <i><font size=-1>repaint() </font></i>after
setting a new value<i><font size=-1></font></i>
<br>and sets the minimum- and maximum value correctly.
<p>Example :
<p><b>&nbsp; void startButton_mouseClicked(MouseEvent e) {</b>
<br>&nbsp;&nbsp;&nbsp; startButton.disable();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// <i>property immediately changed</i>
<br>&nbsp;&nbsp;&nbsp; aProgressBar.setMinimum(0);
<br>&nbsp;&nbsp;&nbsp; aProgressBar.setMaximum(100);
<br>&nbsp;&nbsp;&nbsp; for (int i=0 ; i&lt;100 ; i++) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
aProgressBar.setValue(i);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
<i>property not changed</i>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
aProgressBar.repaint();&nbsp;&nbsp;&nbsp; // <i>property not changed</i>
<br>&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; startButton.enabled();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// <i>property immediately changed</i>
<br><b><i>&nbsp; </i>}</b>
<br><i>// after this method the value of the ProgressBar will be 100 (<font size=-1>getValue()</font>)
and only will be repaint after this method !!!</i>
<br><i></i>&nbsp;<font size=+1></font>
<p><font size=+1>Can someone give me a solution !!!</font><b></b>
<p><b>greetings Jan</b><i></i>
<p><b><font color="#000000">please reply at :</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp; <font size=+1>jan.lacluyse@teleatlas.com</font></font></b>
<br>&nbsp;</html>

--------------92893CCE57C8C1FD0B1BF9C2--
Technical Details
Message-ID: <370A0358.433014F1@teleatlas.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,80ff9302a50d2f4b,start
X-Google-Attributes: gid111d45,public
From: Jan Lacluyse <jan.lacluyse@teleatlas.com>
Subject: JProgressBar problems
Date: 1999/04/06
Message-ID: <370A0358.433014F1@teleatlas.com>
X-Deja-AN: 463227387
X-Accept-Language: en
X-Priority: 1 (Highest)
Content-Type: multipart/alternative; boundary="------------92893CCE57C8C1FD0B1BF9C2"
Organization: Tele Atlas
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing