Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Progress bar to show the progress of a task

Reply
Thread Tools

Progress bar to show the progress of a task

 
 
Charlie Zhang
Guest
Posts: n/a
 
      08-16-2004
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.
 
Reply With Quote
 
 
 
 
Liz
Guest
Posts: n/a
 
      08-16-2004

"Charlie Zhang" <> wrote in message
news: om...
> 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%


 
Reply With Quote
 
 
 
 
Charlie Zhang
Guest
Posts: n/a
 
      08-16-2004
>
> 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.
 
Reply With Quote
 
Paul Lutus
Guest
Posts: n/a
 
      08-16-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show progress bar during page Load code running . . akantrowitz@hotmail.com ASP .Net 2 01-15-2007 06:46 AM
ASPNET 2.0: Progress bar while long taking task =?Utf-8?B?cHVya2th?= ASP .Net 0 01-08-2006 11:22 AM
Re: disable title bar, status bar, and address bar of a browser window John Hann ASP .Net 0 08-21-2004 05:07 AM
disable title bar, status bar, and address bar of a browser window Matt ASP .Net 0 08-21-2004 03:50 AM
progress bar or guage bar Rob ASP General 6 07-12-2003 09:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57