So I am trying to code a typical clock software where you have a stopwatch, clock, alarms, etc. And now I am stuck because my Jlabel does not update. My Thread is working and I already tried it with a System.out.println(); command but it does not work with my JLabel. (Sorry for my bad english)
SwingUtilities.invokeLater(new Runnable() {
public void run() {
int fullmin = 60;
while(stopwatchtimemil != fullmin){
try {
thread.sleep(10);
stopwatchtimemil++;
stopwatchUI.setText(stopwatchtimemin + " : " + stopwatchtimesec + " : " + stopwatchtimemil);
} catch (InterruptedException e) {
e.printStackTrace();
}
if(stopwatchtimemil==fullmin){
stopwatchtimemil=0;
stopwatchtimesec++;
}
if(stopwatchtimesec == fullmin){
stopwatchtimesec =0;
stopwatchtimemin++;
}
}
}
});