From c5487e0bd1b47c4959992eb304d5ce43053e4add Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Fri, 9 Feb 2024 01:53:43 +0100 Subject: [PATCH] =?UTF-8?q?action=20f=C3=BCr=20exitbutton=20hinzugef=C3=BC?= =?UTF-8?q?gt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ChatGUI.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/ChatGUI.java b/src/main/java/ChatGUI.java index 33a6cb7..124332e 100644 --- a/src/main/java/ChatGUI.java +++ b/src/main/java/ChatGUI.java @@ -38,6 +38,7 @@ public class ChatGUI implements ActionListener { menu.add(exit); menu.add(options); bar.add(menu); + exit.addActionListener(this); bar.add(menu); @@ -64,7 +65,9 @@ public class ChatGUI implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - // TODO Auto-generated method stub + if (e.getSource() == exit) { + System.exit(0); + } }