I have just started working with threads. A simple classroom examle included creating three threads, one for displaying and updating the time, second for changing the colour of a label's text, and the third for scrolling the label's text.

Since the three together didn't quite produce the result I needed, I stripped the applet of the last two and worked with just the Timer thread. I don't have the code ready now, but the weirdest thing is the applet completely failed. It didn't crash or something, but instead of updating the counter every second, and adding one to it every time it incremented, it went on adding either 8 or 16 to the counter. Also the updates didn't take place exactly at every second.

Later, I changed the applet to an application, and that ran just fine. Does anyone know why the Timer thread misbehaved in the applet?

.