Progress bar to show the progress of a task  
Author Message
qzhang





PostPosted: 2004-8-16 15:26:00 Top

java-programmer, Progress bar to show the progress of a task In my application one click on the start button will fire one specific
task which includes some numerical computation routines and data
visualization routines.

Want to use progress bar to show the progress of the task execution,
even after reading sun's java swing tutorials still not clear how to
set the maximum length of the progress bar and update the progress
status.

Really appreciate your time and kind help!

Thanks a lot.
 
Liz





PostPosted: 2004-8-16 15:47:00 Top

java-programmer >> Progress bar to show the progress of a task
"Charlie Zhang" <email***@***.com> wrote in message
news:email***@***.com...
> In my application one click on the start button will fire one specific
> task which includes some numerical computation routines and data
> visualization routines.
>
> Want to use progress bar to show the progress of the task execution,
> even after reading sun's java swing tutorials still not clear how to
> set the maximum length of the progress bar and update the progress
> status.
>
> Really appreciate your time and kind help!
>
> Thanks a lot.

Only your application can know how long the task is going to be.
If you are reading a file, for example, you can map the file size
to 100% and the current position in the file divided by the file
size to be the current completion percent. If you just want to know
how to set the value: setProgress(50); will set it to 50%


 
qzhang





PostPosted: 2004-8-16 23:43:00 Top

java-programmer >> Progress bar to show the progress of a task >
> Only your application can know how long the task is going to be.
> If you are reading a file, for example, you can map the file size
> to 100% and the current position in the file divided by the file
> size to be the current completion percent. If you just want to know
> how to set the value: setProgress(50); will set it to 50%

Thanks a lot, but actually the task associated with that button is
complicated and hard to estimate the whole work load. Maybe I shall
consider other swing feature to just show that the computer is busy.
Is cursor a good
choice?

Thanks so much.
 
 
Paul Lutus





PostPosted: 2004-8-17 1:54:00 Top

java-programmer >> Progress bar to show the progress of a task Charlie Zhang wrote:

>>
>> Only your application can know how long the task is going to be.
>> If you are reading a file, for example, you can map the file size
>> to 100% and the current position in the file divided by the file
>> size to be the current completion percent. If you just want to know
>> how to set the value: setProgress(50); will set it to 50%
>
> Thanks a lot, but actually the task associated with that button is
> complicated and hard to estimate the whole work load.

Translation: "I cannot determine in advance a total count, but I want to
show task progress." Is this correct? If so:

JProgressBar.setIndeterminate

public void setIndeterminate(boolean newValue)

Sets the indeterminate property of the progress bar, which determines
whether the progress bar is in determinate or indeterminate mode. An
indeterminate progress bar continuously displays animation indicating that
an operation of unknown length is occurring. By default, this property is
false. Some look and feels might not support indeterminate progress bars;
they will ignore this property.

--
Paul Lutus
http://www.arachnoid.com