Browse Source

Logik verbessert

remotes/origin/server
Paul Kattenborn 11 months ago
parent
commit
c17abd8dbc
  1. 4
      src/main/java/ChatGUI.java

4
src/main/java/ChatGUI.java

@ -136,7 +136,9 @@ public class ChatGUI implements ActionListener {
if (e.getSource() == inputTextField || e.getSource() == sendButton) { if (e.getSource() == inputTextField || e.getSource() == sendButton) {
String inputText = inputTextField.getText(); String inputText = inputTextField.getText();
inputTextField.setText(""); inputTextField.setText("");
if (!inputText.isEmpty()) {
addMessage(inputText); addMessage(inputText);
}
} }
if (e.getSource() == red) { if (e.getSource() == red) {
outputTextArea.setForeground(Color.RED); outputTextArea.setForeground(Color.RED);
@ -161,7 +163,9 @@ public class ChatGUI implements ActionListener {
String message = inputTextField.getText(); String message = inputTextField.getText();
inputTextField.setText(""); inputTextField.setText("");
addMessage(message); addMessage(message);
if(!message.isEmpty()) {
sendPopupMessage(message); sendPopupMessage(message);
}
} }
} }

Loading…
Cancel
Save