当前位置: 技术问答>java相关
jar文件不能运行!
来源: 互联网 发布时间:2015-05-10
本文导语: // game.java 为主文件( 还有其他文件) public class game extends Applet implements Runnable{ // code . . . public static void main(String args[]) { // code } } 该class是applet但又有main方法(胡涂),在jcreator下可...
// game.java 为主文件( 还有其他文件)
public class game extends Applet
implements Runnable{
// code
.
.
.
public static void main(String args[])
{ // code }
}
该class是applet但又有main方法(胡涂),在jcreator下可以执行(直接运行game.class,不用html文件),但我手工建了meta_inf和menifest.mf后再做成jar却不能运行。麻烦高手帮我想想办法。
public class game extends Applet
implements Runnable{
// code
.
.
.
public static void main(String args[])
{ // code }
}
该class是applet但又有main方法(胡涂),在jcreator下可以执行(直接运行game.class,不用html文件),但我手工建了meta_inf和menifest.mf后再做成jar却不能运行。麻烦高手帮我想想办法。
|
这是我在一个Applet中写的一个方法:
private void loadImg() {
tracker = new MediaTracker(this);
imagelists = new Image[14]; // Create the Image Lists
imagelists[0] = getImage(getCodeBase(),"./image/room.gif");
imagelists[1] = getImage(getCodeBase(),"./image/teacher.gif");
imagelists[2] = getImage(getCodeBase(),"./image/line.GIF");
imagelists[3] = getImage(getCodeBase(),"./image/line_last.GIF");
imagelists[4] = getImage(getCodeBase(),"./image/line_notlast.GIF");
for(int i=0;i
private void loadImg() {
tracker = new MediaTracker(this);
imagelists = new Image[14]; // Create the Image Lists
imagelists[0] = getImage(getCodeBase(),"./image/room.gif");
imagelists[1] = getImage(getCodeBase(),"./image/teacher.gif");
imagelists[2] = getImage(getCodeBase(),"./image/line.GIF");
imagelists[3] = getImage(getCodeBase(),"./image/line_last.GIF");
imagelists[4] = getImage(getCodeBase(),"./image/line_notlast.GIF");
for(int i=0;i