I want to use a JProgressBar but I don't have any measurement of progress for how long the task will take to complete. The idea is to have a progress bar displaying the status of a shutdown process but I don't know how long it takes, and I have no way of editing the class that does the shutdown process.
Is there a way to use a JProgressBar without having any indication of the progress?
Call setIndeterminate(true)
.
From the javadocs:
To indicate that a task of unknown length is executing, you can put a progress bar into indeterminate mode. While the bar is in indeterminate mode, it animates constantly to show that work is occurring. As soon as you can determine the task's length and amount of progress, you should update the progress bar's value and switch it back to determinate mode.