From f509cbb516b1aa7149bcb46b69810fb804dc8ce9 Mon Sep 17 00:00:00 2001 From: Leon Montag Date: Fri, 30 Dec 2022 01:11:48 +0100 Subject: [PATCH] Added Close functionality to CloseBtn --- src/main/java/Gui/ActionHandler.java | 15 +++++++++++++++ src/main/java/Gui/gui.java | 2 ++ target/MiniGameProject-1.0-SNAPSHOT.jar | Bin 3695 -> 4305 bytes target/maven-archiver/pom.properties | 2 +- .../compile/default-compile/inputFiles.lst | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/java/Gui/ActionHandler.java diff --git a/src/main/java/Gui/ActionHandler.java b/src/main/java/Gui/ActionHandler.java new file mode 100644 index 0000000..f1adf45 --- /dev/null +++ b/src/main/java/Gui/ActionHandler.java @@ -0,0 +1,15 @@ +package Gui; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + + +public class ActionHandler implements ActionListener { + + public void actionPerformed(ActionEvent e) { + if (e.getSource() == gui.CloseBtn) { + System.exit(0); + } + } + +} diff --git a/src/main/java/Gui/gui.java b/src/main/java/Gui/gui.java index ef552d6..599fab7 100644 --- a/src/main/java/Gui/gui.java +++ b/src/main/java/Gui/gui.java @@ -33,6 +33,8 @@ public class gui { public void createButtons() { StartBtn = new JButton("Starte Spiel"); CloseBtn = new JButton("Schlieen"); + CloseBtn.addActionListener(new ActionHandler()); + } public void createPanel() { diff --git a/target/MiniGameProject-1.0-SNAPSHOT.jar b/target/MiniGameProject-1.0-SNAPSHOT.jar index 4dd2e3175a69f944ef57644f0bfa5525eab8317a..dab2b23728815fb4b5a35dc101e2e45acf1e9b2b 100644 GIT binary patch delta 2320 zcmZ`*c{CIX7oU|G>sU(4GL}a6Bx__}r)<#}Tb72#nmy|v(Iig{N|CiJO_&VHmNG+@ zMvQ%zBovA8B=6Dp-uJ#g-gnQr_ndprJ->U;z31HDT@~sRW4A(sA#8vH@k(b$0X@@C zJpkg;8Daz+{Gnaj67V${2msW8004pg6q8WAqMkY--)~b8J%XH-NV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E*QDp-%A@POtDhDe^ZmCrS~N&f@p4OZYf$lZ8l_PvgO|V`|$H;Kb(2)fjBTUdfLNu zY4xOja8>b3;@=I~>)8MR diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties index 27e88a8..8d2892b 100644 --- a/target/maven-archiver/pom.properties +++ b/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Fri Dec 30 01:08:26 CET 2022 +#Fri Dec 30 01:11:12 CET 2022 groupId=MiniGameProject artifactId=MiniGameProject version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 8dfad02..03f0c51 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1,2 +1,3 @@ +C:\Users\Leon\MiniGameProject\src\main\java\Gui\ActionHandler.java C:\Users\Leon\MiniGameProject\src\main\java\Gui\gui.java C:\Users\Leon\MiniGameProject\src\main\java\main.java