这个程序提示这是为啥?

leeak 2003-08-22 05:05:21
源程序:

import java.awt.*;
import java.applet.*;
public class lp1 extends Applet
{
carton carton_1=null;//declare this is a carton example
public void start()
{
if (carton_1==null)//if example not intailized
{
carton_1=new carton(getGraphics(),this);//intailized or not
carton_1.start();//start or not
}
}
public void paint(Graphics g)
{update(g);}
public void update(Graphics g)
{}
public void stop()
{
carton_1.stop();//example stop?
carton_1=null;//free the resource
}
//key press event
public bollean keyDown(Event e,int key)
{
if (key==Event.UP)//if keypress is up
carton_1.set_direction(0);//bollean is true
if (key==Event.DOWN)//if keypress is down
carton_1.set_direction(1);//bollean is true
if (key==Event.LEFT)//if keypress is left
carton_1.setdirection(2);//bollean is true
if (key==Event.RIGHT)//if keypress is right
carton_1.setdirection(3);//boolean is true
if (key=='s')
{
carton_1.gamerun=true;carton_1.position_x=170;carton_1.position_y=320;}
return true;
}
//key up event
public boolean keyUP(Event e,int key)
{
if (key==Event.UP)//if key up is up
carton_1.clear_direction(0);//boolean up is false
if (key==Event.DOWN)//if key is down
carton_1.clear_direction(1);
if (key==Event.LEFT)
carton_1.clear_direction(2);
if (key==Event.REGHT)
carton_1.clear_direction(3);
if (key=32)
carton_1.fire_wanna_switch(true);
return true;
}
}
//player's class
class carton extends Thread

{
Graphics g,off_screen=null;
boolean up=false,down=false,left=false,right=false;
boolean img_now_switch=true;
boolean fire_wanna=false;
int position_x=170,position_y=320,pos_x,pos_y;
int i=0,j=0,k_left=0,k_right=0;
int bullet_amount_left=0;
int bullet_amount_right=0;
int bullet_position_left[][]=new int[301][2];
int plane_died=-1;
int enemy_lose=0,enemy_bullet_lose=0;
int enemy[][]=new int[31][2];
int enemy_bullet[][]=new int[31][2];
int enemy_dx[]=new int[31];
int enemy_bullet_dx[]=new int[31];
int enemy_amount=0,enemy_bullet_amount=0;
int enemy_plane=0,enemy_ball=0;
int enemy_status[]=new int[31];
int enemy_bullet_status[]=new int[31];
Image img_center,img_right,img_left;
Image img_now;
Image map;
Image enemy_image,enemy_bullet_image,flame,ball;
int mapposX=50,mapposY=50;
Image bullet_left,bullet_right;
Image off_screen_buffer=null;
Applet applet;
int sleep_time=30;
MediaTracker track;
Rectangle enemy_rect[]=new Rectangle[31];
Rectangle enemy_bullet_recnt[]=new Rectangle[31];
boolean gamerun=false;
int killtotalo=0;
}
编译后出现:errro can not read lp1.java
^ 1 erro
...全文
41 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
096628 2003-08-22
  • 打赏
  • 举报
回复
另外要有一个接口 呀!!ININ()啦
zcjl 2003-08-22
  • 打赏
  • 举报
回复
到java文件所在的目录下
javac lpl.java试试
nbm0 2003-08-22
  • 打赏
  • 举报
回复
是不是你编译的路径不对

你的编译器找不到1p1.java
zql8289 2003-08-22
  • 打赏
  • 举报
回复
没有MAIN()方法!找不到程序的入口!
diewikwang 2003-08-22
  • 打赏
  • 举报
回复
显然是找不到lpl.java这个文件了。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧