From 7e1bedfa3f05cd2fc02546c6ead1c849387668b7 Mon Sep 17 00:00:00 2001 From: bingor_yhj Date: Thu, 29 Sep 2022 15:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9D=A6=E5=85=8B=E5=A4=A7=E6=88=98-=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=88=9D=E5=A7=8B=E5=8C=96=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/msb/TankDemo.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); + } + }); } }