I am trying to simulate a progressbar process using a for loop. The whole loop represent 100% so as the loop increases, the progressbar should also increase until the loop is done it will be 100% However in netbean UI the progress bar doesnt show as expected.
int i;
progressBar.setStringPainted(true);
for (i = 0; i < 99999; i++) {
i = i;
progressBar.setValue(i);
System.out.println(i);
}
progressBar.updateUI();