我想用多线程实现一个电子表效果,但是运行中不能显示时间,请各位帮一下忙,谢谢
//<applet code= clock1.java width=800 height=600></applet>import java.applet.Applet;import java.awt.*;
import java.util.Date; 
import java.text.*; public class clock2 extends Applet   implements Runnable
{


Label text=new Label("现在时刻");
TextField Timer=new TextField(10);
public void init()
{
add(text);
add(Timer);
}
   public void start()
{
   Thread ClockA=new Thread(this,"");
   ClockA.start();    }
    public void run()
{
while(true)
{    
try
{
                          Thread.sleep(1);     }
    catch(InterruptedException e){}
Date d = new Date(); 
            //String str = d.toString(); 
            SimpleDateFormat sdf=new SimpleDateFormat("kk:mm:ss"); 
            String str=sdf.format(d);
Timer.setText(str);
}
}
}