J2SE 坦克大战 马士兵(2)
2012-03-15 20:12
253 查看
项目二的具体要求:
代码:public class TankClient extends Frame{
public void lanuchFrame(){
this.setLocation(300,200);
this.setSize(800,600);
this.setResizable(false);
setVisible(true);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
Frame f =(Frame)e.getSource();
f.setVisible(false);
}
});
//添加嵌套类,继承WindowAdapter接口,主要是WindowListener接口方法多,重写很麻烦
}
public static void main(String[] args) {
new TankClient().lanuchFrame();
}
}
代码:public class TankClient extends Frame{
public void lanuchFrame(){
this.setLocation(300,200);
this.setSize(800,600);
this.setResizable(false);
setVisible(true);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
Frame f =(Frame)e.getSource();
f.setVisible(false);
}
});
//添加嵌套类,继承WindowAdapter接口,主要是WindowListener接口方法多,重写很麻烦
}
public static void main(String[] args) {
new TankClient().lanuchFrame();
}
}
相关文章推荐
- J2SE 坦克大战 马士兵(5)
- J2SE 坦克大战 马士兵(5)
- J2SE 坦克大战 马士兵(1)
- J2SE 坦克大战 马士兵(3)
- J2SE 坦克大战 马士兵(4)
- 马士兵的坦克大战,以前做过,今天又找出来看了看
- nyoj 284-坦克大战
- 脚本游戏之四: 坦克大战源码注释(待续。。。)
- 自学Unity笔记 坦克大战项目
- java坦克大战0.3(画出代表坦克的实心圆)
- 坦克大战 python 游戏
- 坦克大战,使敌人坦克随机运动
- cocos2d-x的初步学习十六之坦克大战三
- nyo-284-坦克大战--(bfs+优先队列)
- NUOJ 284 坦克大战【BFS】
- 记录Java学习过程之坦克大战1
- NYOJ 284--坦克大战【BFS && 优先队列】
- java视频 坦克大战制作
- 坦克大战中,给子弹加载图片
- NYOJ-284 坦克大战 ------BFS/优先队列