i build an Application and i have a button do a lot of things when i press it the application is freeze it for some second. So i just want put a jProgressBar here is my code :
JOptionPane.showMessageDialog(rootPane, "We are done in just "+(l2-l)+" MS");
What you need to do is perform your lengthy/taxing operations on another thread, and then, from that thread, adjust the value of your
JProgressBar. The progress will then be visible.