diff --git a/src/com/msb/TankDemo.java b/src/com/msb/TankDemo.java index cc016a8..27eeb6f 100644 --- a/src/com/msb/TankDemo.java +++ b/src/com/msb/TankDemo.java @@ -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); + } + }); } }