java包的引用
importjava.awr.*;importjava.applet.*;publicclassHelloWorldAppletextendsApplet{//anapp...
import java.awr.*;
import java.applet.*;
public class HelloWorldApplet extends Applet { //an applet
public void paint(Graphics g){
g.drawString ("Hello World!",20,20);
}
} 以上是我的程序体,以下是错误提示:
C:\test>javac HelloWorldApplet.java
HelloWorldApplet.java:1: package java.awr does not exist
import java.awr.*;
^
HelloWorldApplet.java:4: cannot resolve symbol
symbol : class Graphics
location: class HelloWorldApplet
public void paint(Graphics g){
^
2 errors 展开
import java.applet.*;
public class HelloWorldApplet extends Applet { //an applet
public void paint(Graphics g){
g.drawString ("Hello World!",20,20);
}
} 以上是我的程序体,以下是错误提示:
C:\test>javac HelloWorldApplet.java
HelloWorldApplet.java:1: package java.awr does not exist
import java.awr.*;
^
HelloWorldApplet.java:4: cannot resolve symbol
symbol : class Graphics
location: class HelloWorldApplet
public void paint(Graphics g){
^
2 errors 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询