Link to home
Start Free TrialLog in
Avatar of Mr_A_Smith
Mr_A_Smith

asked on

Using a JProgressBar

hello!

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.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

If the length of the processing is not known, you'll have to setDeterminate(false) on the JProgressBar
ASKER CERTIFIED SOLUTION
Avatar of TrekkyLeaper
TrekkyLeaper
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or rather

setIndeterminate(true);