|
|
@ -103,12 +103,7 @@ public class ChatClient extends JFrame implements KeyListener { |
|
|
|
} |
|
|
|
|
|
|
|
private void initGui() { |
|
|
|
outputTextArea = new JTextArea(); |
|
|
|
outputTextArea.setEditable(false); |
|
|
|
outputTextArea.setBorder(BorderFactory.createTitledBorder("Chat")); |
|
|
|
outputTextArea.setBackground(Color.lightGray); |
|
|
|
|
|
|
|
outputScrollPane = new JScrollPane(outputTextArea); |
|
|
|
prepareOutputTextArea(); |
|
|
|
|
|
|
|
timeLabel = new JLabel(); |
|
|
|
updateTime(); |
|
|
@ -126,6 +121,16 @@ public class ChatClient extends JFrame implements KeyListener { |
|
|
|
setDefaultCloseOperation(EXIT_ON_CLOSE); |
|
|
|
setLocationRelativeTo(null); |
|
|
|
} |
|
|
|
|
|
|
|
private void prepareOutputTextArea() { |
|
|
|
outputTextArea = new JTextArea(); |
|
|
|
outputTextArea.setEditable(false); |
|
|
|
outputTextArea.setBorder(BorderFactory.createTitledBorder("Chat")); |
|
|
|
outputTextArea.setBackground(Color.lightGray); |
|
|
|
|
|
|
|
outputScrollPane = new JScrollPane(outputTextArea); |
|
|
|
} |
|
|
|
|
|
|
|
private void receiveMessages() { |
|
|
|
try { |
|
|
|
connectionToServer = new Socket(address, Constants.PORT); |
|
|
|