So basically i have a JOptionPane which will print out an int, sort of like a progress update. I also have a while loop that executes some code and every time it runs it adds 1 to a int. Now i would like to have the joptionpane update once in a while with the current number that the int has. ive been trying to do this with a timer but my 16 y/o stubborn mind cant figure it out! any help is greatly appreciated.
Heres some example code
int printNumber = 0, loops = 100;
while(loops != 100){
...
printNumber++;
}
JOptionPane.showMessageDialog(frame, "\nCurrently Loading... "+ printNummber, "Loading", JOptionPane.INFORMATION_MESSAGE);
now i'd like the OptionPane to update the value printNumber every few seconds, i cant figure it out xD thanks in advance!! :)