From 8771dad58d10196c93e727faefdb43be66295a61 Mon Sep 17 00:00:00 2001 From: Xiao <2985385632@qq.com> Date: Sat, 13 May 2023 16:29:58 +0800 Subject: [PATCH] src --- src/com/sheep/view/Game.java | 2 +- src/com/sheep/view/Start.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/sheep/view/Game.java b/src/com/sheep/view/Game.java index 32e7c9a..6fc1fae 100644 --- a/src/com/sheep/view/Game.java +++ b/src/com/sheep/view/Game.java @@ -36,7 +36,7 @@ public class Game extends JFrame { this.setTitle("java羊了个羊");//标题 this.setSize(425,800);//窗口大小 - //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭java界面退出程序 + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭java界面退出程序 this.setLocationRelativeTo(null);//窗体剧中 this.setLayout(null);//设置绝对布局 diff --git a/src/com/sheep/view/Start.java b/src/com/sheep/view/Start.java index f9c0718..5f8679e 100644 --- a/src/com/sheep/view/Start.java +++ b/src/com/sheep/view/Start.java @@ -47,6 +47,7 @@ public class Start extends JFrame { @Override public void actionPerformed(ActionEvent e) { new Game(); + Start.super.dispose(); } }); }