新手,eclipse不能用的问题.高分悬赏!!!

程序如下:
public class helloprogram extends GraphicsProgram
{
public void run()
{
GLabel Label=new GLabel("hello world",100,75);
Label.setColor("Color.RED");
add(Label);
}
}

错误:1、GraphicsProgram cannot be resolved to a type

2、Multiple markers at this line
- GLabel cannot be resolved to
a type

请问这是什么原因啊,GAR包没导入吗?怎么导入啊。
我下载了JDK,都按照网上的方法设置好变量了,求解!!!高分悬赏!!!

GraphicsProgram

这个类是从那里导入的?

如果你 这是你编译时出的错,那就是你没有导入包
在eclipse的工程上右键->属性->java build path->libraries->add External jars
来选择。

如果是运行时出的问题,
那就是你运行的classpath中,找不到相应的jar文件。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-03-26
Jar包没有正常的导入,
找不到 GraphicsProgram
找不到 GLabel

添加完jar 不用重启的

如果你的acm.jar 导入正常的话,

在class 类的上面添加引用

import acm.graphics.GLabel;
import acm.program.GraphicsProgram;
第2个回答  2013-03-26
应该是少了JAR包,你要的GraphicsProgram类我没用过,感觉应该不是标准JAVA类库里面的,应该是要下载其他的类库。
你先找到和这个类有关的JAR包,然后在ECLIPSE项目名上点击右键,选择属性,找到java build path选项卡,在library里面点击add external jars然后找到你的这个JAR包,重启eclipse应该就可以了。
第3个回答  2013-03-26
GraphicsProgram 如果这个确实能用,那就是架包没有引入(我没用到过这个);引入架包的方法为:选中工程名,点击右键 -> "Build Path" -> "Configure Build Path..." -> 在"Java Build Path"里点击"Libraries" -> 架包在项目内,点击"Add JARs...",如果在其他地方,点击"Add External JARs.." -> 找到架包一路保存就行了。
第4个回答  2013-03-26
ar包没有正常的导入
相似回答