您的位置:首页 > 其它

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();

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: