hi, I've used the JProgressBar. you'll have to know the size of your file and increase the progress appropriately (that's what you have already done while reading the file). chantal
But suppose if i am running a process which does reading a file and doing some operation like calculating something and then saving the file. and i want to show the JProgressBar once i have started the process.In that case i dont know how much time the operation will take and i think this can't be done by knowing simply the size of file
Originally posted by Chantal Ackermann: hi, I've used the JProgressBar. you'll have to know the size of your file and increase the progress appropriately (that's what you have already done while reading the file). chantal
you can decide when to increment the progress bar. for example: you give the whole operation the value 1000 and then you decide how much every part of the process will cost. say, reading the file 700, calculating 200 and saving 100. while you read you may have a while-loop where you can increment in small steps until you reach the 700. however, at the end of the operation 1000 should be reached and that are the 100% of the progress bar. (remember, 1000 was just an example. it's your decision what value you set for the 100%) chantal
I promise I will be the best, most loyal friend ever! All for this tiny ad: