东西绝对不多说,直接看
看了拷贝就懂了
,直接可以拷贝下面的东西,然后记得把那个 BLOCK的名字改成你自己的类名,这个很关键哦,不然是错的可别怪我,呵呵~~ import java
*; import java
*; import javax
*; import java
applet
*; import java
String
*; import java
*; import java
*; publicclass Block extends JPanel implements ActionListener,KeyListener// 应该是继承 JPanel{ static Button but [] = new Button[6]; static Button noStop = new Button(" 取 消 暂 停" ); static Label scoreLab = new Label(" 分数 :" ); static Label infoLab = new Label(" 提示 :" ); static Label speedLab = new Label(" 级数 :" ); static Label scoreTex = new Label("0" ); static Label infoTex = new Label(" " ); static Label speedTex = new Label("1" ); static JFrame jf = new JFrame(); static MyTimer timer ; static ImageIcon icon =new ImageIcon("resource/Block
jpg"); static JMenuBar m