From c17abd8dbc1cfb226bcad12633afea00a47abaa3 Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Fri, 9 Feb 2024 20:31:50 +0100 Subject: [PATCH] Logik verbessert --- src/main/java/ChatGUI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/ChatGUI.java b/src/main/java/ChatGUI.java index d8453fc..2c9f5bb 100644 --- a/src/main/java/ChatGUI.java +++ b/src/main/java/ChatGUI.java @@ -136,7 +136,9 @@ public class ChatGUI implements ActionListener { if (e.getSource() == inputTextField || e.getSource() == sendButton) { String inputText = inputTextField.getText(); inputTextField.setText(""); + if (!inputText.isEmpty()) { addMessage(inputText); + } } if (e.getSource() == red) { outputTextArea.setForeground(Color.RED); @@ -161,7 +163,9 @@ public class ChatGUI implements ActionListener { String message = inputTextField.getText(); inputTextField.setText(""); addMessage(message); + if(!message.isEmpty()) { sendPopupMessage(message); + } } }