final ProgressBarExample it = new ProgressBarExample();
JFrame frame = new JFrame("Progress Bar Example");
frame.addWindowListener(new BasicWindowMonitor());
frame.setContentPane(it);
frame.pack();
frame.setVisible(true);
for (int i = MY_MINIMUM; i <= MY_MAXIMUM; i++) {
final int percent=i;
try {
SwingUtilities.invokeAndWait(
new Runnable() {
public void run() {
it.updateBar(percent);
}
});
java.lang.Thread.sleep(100);
} catch (Exception e) {;}
}