Skip to main content

Refreshing jLabel

No replies
mesbih
Offline
Joined: 2008-04-20

Please i need help, i want to change text of jLabel in loop.

int i=0;
Thread th;
th = new Thread();
th.start();

try {
for(i=0;i<=3;i++) {
jLabel1.setText(String.valueOf(i));
th.sleep(1000);
}

} catch ( InterruptedException exception) {
exception.printStackTrace(); }
}
it is show just last number.
Thanks