坦克大战-完成初始化窗口

Network
bingor_yhj 2 years ago
parent e060f902d3
commit 7e1bedfa3f

@ -1,5 +1,9 @@
package com.msb;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* @Author bingor
* @Date 2022-09-29 11:02
@ -9,7 +13,17 @@ package com.msb;
public class TankDemo {
public static void main(String[] args) {
Frame frame = new Frame();
frame.setTitle("Tank war");
frame.setSize(200, 100);
frame.setResizable(true);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}

Loading…
Cancel
Save