Using a JProgressBar
Posted on 2004-09-26
I want to use a JProgressBar in a splash screen of a java program i am writing. The program at the start reads some text files, processes them etc. I want to indicate how much of the processing is done by using a JProgressBar, so the user essentially knows how much is left before the main GUI part of the app shows.
How can i determine the length of the task? How is it usually done, currently, the only way i am aware of tackling this problem is to increment the progress bar by 1 in different locations of the code untill i finally have incremented to 100 (the max value of the JProgressBar i want to use) at the end of the task. To me this seems tedious and very unprofessional, i was wondering how professional java developers would indicate how much of a task is complete using a JProgressBar.
Thx for any tips or help.