Applet代码的编译问题...请帮助我

时间:2019-05-08 18:06:39

标签: java compiler-errors applet

我是Applet的新手,请帮助我完成此工作...我编写了Hello World代码,并在编译时遇到如下所述的错误-

HelloWorldApplet.java:1: error: package Java.applet does not exist
import Java.applet.Applet;

HelloWorldApplet.java:2: error: package Java.awt does not exist
import Java.awt.Graphics;
           ^
HelloWorldApplet.java:3: error: cannot find symbol
public class HelloWorldApplet extends Applet
                                  ^
symbol: class Applet
HelloWorldApplet.java:5: error: cannot find symbol
public void paint(Graphics g)
              ^
symbol:   class Graphics
location: class HelloWorldApplet

这是我最简单的代码-

import Java.applet.Applet;
import Java.awt.Graphics;
public class HelloWorldApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hello World!", 50, 25);
}
}

0 个答案:

没有答案