I have a working program, which uses check boxes to let the user select specific directories, and after the user presses a button, the selected directories are cleared.
What I want to do now, is make the currently non-functional progress bar, fill up as the directories are being cleared. I've looked over the Java documentation on JProgressBar countless times, as well as watching countless tutorials on making and using a progress bar, but everything so far just shows how to manually set the value and message of the progress bar, and not how to assign it to an actual part of a task.
My question is, where would I put in the different commands for the progress bar, in order to make it a functional progress bar, rather than just a bar that fills up no matter what happens. For example, how would I make it, so that when a specific directory has a lot to delete, and it takes it a while, the progress bar starts to fill up more slowly? and vise versa for if a directory has almost nothing in it.
What I have tried:
I have not tried anything yet.