I cannot seem to understand why when working with certain values the JProgressBar will sort of freeze and stop making calculations. For example the code bellow will only show zero all of the time;
...
int value = (100/maxGenerations)*i; //maxGenerations = 2500
final int barValue = value;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
progressBar.setValue(barValue);
}
});
however if with the same implementation i do the following it works (of course not accurately as is just garbage calculations):
...
int value = (i/100); //where 'i' increments until = 2500
final int barValue = value;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
progressBar.setValue(barValue);
}
});
any ideas why?