Commit 2daef90e authored by 9731087's avatar 9731087

first phase

parent 6b792e98
...@@ -7,6 +7,7 @@ public class ChatArea extends JTextArea { ...@@ -7,6 +7,7 @@ public class ChatArea extends JTextArea {
super(ROWS, COLUMNS); super(ROWS, COLUMNS);
this.setEditable(false); this.setEditable(false);
this.setLineWrap(true); this.setLineWrap(true);
setVisible(true);
} }
public void addMessage(String username, String message) { public void addMessage(String username, String message) {
......
...@@ -17,6 +17,7 @@ public class ChatRoomGUI extends JFrame { ...@@ -17,6 +17,7 @@ public class ChatRoomGUI extends JFrame {
this.setVisible(true); this.setVisible(true);
ChatArea chatBox = new ChatArea(); ChatArea chatBox = new ChatArea();
this.add(new JScrollPane(chatBox), BorderLayout.CENTER); this.add(new JScrollPane(chatBox), BorderLayout.CENTER);
chatBox.addMessage(" Ostad", " Hello!");
MessageArea messageArea = new MessageArea(); MessageArea messageArea = new MessageArea();
this.add(messageArea, BorderLayout.SOUTH); this.add(messageArea, BorderLayout.SOUTH);
this.setVisible(true); this.setVisible(true);
...@@ -25,6 +26,7 @@ public class ChatRoomGUI extends JFrame { ...@@ -25,6 +26,7 @@ public class ChatRoomGUI extends JFrame {
participantsArea.addNewParticipant(" Amirmehdy"); participantsArea.addNewParticipant(" Amirmehdy");
participantsArea.addNewParticipant(" Abtin"); participantsArea.addNewParticipant(" Abtin");
participantsArea.removeParticipant(" Amirmehdy"); participantsArea.removeParticipant(" Amirmehdy");
participantsArea.addNewParticipant(" Ostad");
this.setVisible(true); this.setVisible(true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment