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