How to change a JLabel's text in a loop without switching so fast the user can't see it?

Posted by guilgamos on Stack Overflow See other posts from Stack Overflow or by guilgamos
Published on 2010-06-16T18:50:14Z Indexed on 2010/06/16 19:12 UTC
Read the original article Hit count: 223

Filed under:
|
|
|

I want to create a simple clock using Java. The code is so simple that I will give an example:

for(int i=0;i<=60;i++)
   jLabel11.setText( Integer.toString(i) );

The problem is while I'm running my program the result didn't show each update in sequence. It show only the 60 digit immediately, without showing the change from 1 to 2 to 3 ...

How can i fix this problem?

© Stack Overflow or respective owner

Related posts about java

Related posts about thread