How can I add a progressbar that would show how much time will it take untill the current process in done?
I do know how to construct and use a progressbar, in simple ways, but I do not know how to bound them with a process.
For example when I click a button, I would like to open a jfilechooser, and this may take some time. I want the user to know that the app did not crash and to give an idea of how much time will it take until the jfilechooser appears.
Thanks in advance
jfilechoosertakes a lot of time? Or do you mean opening the actual file and processing it in background thread? If the latter, simply updateJProgressBaronce in a while from that thread (remember about thrad safety). BTW please tag your question with swing.jfilechooserwas only an example, because at the moment, I do have a problem with it, takes up to 30 sec to open at the first button click.Then at the second try, drops to 3 sec. But anyway I needed to assign a progressbar to my program because it's a large one with 3d graphics