|
@ -142,11 +142,13 @@ public class ChatGUI implements ActionListener { |
|
|
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 20)); |
|
|
outputTextArea.setFont(outputTextArea.getFont().deriveFont(Font.PLAIN, 20)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// add-message method with time stamp |
|
|
private void addMessage(String message) { |
|
|
private void addMessage(String message) { |
|
|
String timeStamp = new SimpleDateFormat("HH:mm:ss").format(new Date()); |
|
|
|
|
|
outputTextArea.append("[" + timeStamp + "] " + message + "\n"); |
|
|
|
|
|
outputTextArea.setCaretPosition(outputTextArea.getDocument().getLength()); |
|
|
|
|
|
|
|
|
String timeStamp = new SimpleDateFormat("HH:mm:ss").format(new Date()); |
|
|
|
|
|
outputTextArea.append("[" + timeStamp + "] " + message + "\n"); |
|
|
|
|
|
outputTextArea.setCaretPosition(outputTextArea.getDocument().getLength()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |