|
@ -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); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|