import java.applet.*;
import java.awt.*;public class clock extends java.applet.Applet implements Runnable
{
Thread clockthread;
public void start()

if(clockthread==null)
{
clockthread=new Thread(this,"clock");
clockthread.start();
}
}
public void run()
{
while(clockthread!=null)
{
repaint();
try
{
clockthread.sleep(1000);
}catch(InterruptedException e){}
}
}
public void paint(Graphics g)
{
Date now=new Date();
g.drawString(now.getHours()+":"+now.getMinutes()+":"+now.getSeconds(),5,10);
}
public void stop()
{
clockthread.stop();
clockthread=null;
}
}提示说18行找不到符号

解决方案 »

  1.   

    你好,我运行了一下,没有你所说的问题,能够成功运行,18行里有一个变量,就是clockthread,看一下你的程序里对不对,但你帖出来的程序没有问题。
      

  2.   

    说错了不好意思 ,提示是28行找不到符号 Date now=new Date();怎么在我这里一直提示这个问题啊?
      

  3.   

    Data在java.util中,你没有import java.util.*;