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行找不到符号
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行找不到符号
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货