Progress Bar
2 posts in topic
Flat View  Flat View

Posted By:   Mike_Stamper
Posted On:   Friday, May 24, 2002 08:13 PM

How does one setup a progress bar to monitor a thread when you don't know how long it will take? Say I want a progress bar to monitor loading a file. How does one make the progress bar reach 100% exactly when the file is loaded?
Depending on how big the file is the load times will be different.

I also need a progress bar to monitor processing of the file. Again, all I know is when the process STARTS and WHEN is is completed, but I do not know anything else.

Thanks for the help,


Re: Progress Bar

Posted By:   Mike_Friedrich  
Posted On:   Tuesday, May 28, 2002 08:57 AM

Or you can simply use the class javax.swing.ProgressMonitorInputStream.

(if it is enough for you)

Regards, Mike

Re: Progress Bar

Posted By:   Laurent_Mihalkovic  
Posted On:   Sunday, May 26, 2002 09:14 PM

A progress bar measures intermediary steps between start and end. it does not necessary mean the time it takes to complete the task. actually, time is rarely the quantity a progressbar can measure. in your case, you could measure against the total size of your file. choose the number of steps you want to show, and calculate the number X of bytes it represents. Then your file loading thread should signal the progress thread every time X bytes have been loaded.

hope this helps,

About | Sitemap | Contact