Article View: borland.public.jbuilder.java.swing
Article #11851JProgressBar problems
From: Jan Lacluyse
Date: Tue, 06 Apr 1999 00:00
Date: Tue, 06 Apr 1999 00:00
78 lines
3884 bytes
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> void startButton_mouseClicked(MouseEvent e) {</b>
<br> startButton.disable();
// <i>property immediately changed</i>
<br> aProgressBar.setMinimum(0);
<br> aProgressBar.setMaximum(100);
<br> for (int i=0 ; i<100 ; i++) {
<br>
aProgressBar.setValue(i); //
<i>property not changed</i>
<br>
aProgressBar.repaint(); // <i>property not changed</i>
<br> }
<br> startButton.enabled();
// <i>property immediately changed</i>
<br><b><i> </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> <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"> <font size=+1>jan.lacluyse@teleatlas.com</font></font></b>
<br> </html>
--------------92893CCE57C8C1FD0B1BF9C2--
Technical Details
Message-ID:
<370A0358.433014F1@teleatlas.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow 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