diff options
author | Dor Bivas <dor1_b@walla.com> | 2013-12-03 17:23:16 +0200 |
---|---|---|
committer | Dor Bivas <dor1_b@walla.com> | 2013-12-03 17:23:16 +0200 |
commit | 0bb21a5b0aa2a835d6a8aa5f8cbe46388c428f13 (patch) | |
tree | e378da88b0c39f8a961e05dd00b328fa7ae72819 /src/Client/UserInterface.java | |
parent | 586ddb48f38625bbea43079810ad62efa474d0ac (diff) |
Connecting between server output to client
Diffstat (limited to 'src/Client/UserInterface.java')
-rw-r--r-- | src/Client/UserInterface.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Client/UserInterface.java b/src/Client/UserInterface.java index a354e97..20b235c 100644 --- a/src/Client/UserInterface.java +++ b/src/Client/UserInterface.java @@ -17,9 +17,15 @@ public class UserInterface extends JFrame implements ActionListener private JTextField message;
private JTextArea output;
private ChatClient client;
+ private ChatClientReader read;
private JTextField host = new JTextField("localhost", 15);
private JTextField port = new JTextField("6667", 4);
+ public void outputWriter (String line)
+ {
+ output.append(line + "\n");
+ }
+
/** Graphic interface recipient the client*/
public UserInterface(ChatClient client)
{
@@ -30,7 +36,7 @@ public class UserInterface extends JFrame implements ActionListener output = new JTextArea(10, 20);
output.setBackground(Color.gray);
-
+
JPanel msgPanel = new JPanel();
JPanel conPanel = new JPanel();
JPanel vertPanel = new JPanel();
@@ -53,13 +59,15 @@ public class UserInterface extends JFrame implements ActionListener vertPanel.setLayout(new BoxLayout(vertPanel, BoxLayout.PAGE_AXIS));
+
+
msgPanel.add(connect);
msgPanel.add(send);
msgPanel.add(new JLabel("Message:"));
msgPanel.add(message);
msgPanel.add(stop);
-
+
conPanel.add(new JLabel("host:"));
conPanel.add(host);
@@ -75,6 +83,8 @@ public class UserInterface extends JFrame implements ActionListener setVisible(true);
}
+
+
/** Syncing the the action that the button send to the perform
* @param name of the action */
int counterClick = 0;
@@ -91,7 +101,6 @@ public class UserInterface extends JFrame implements ActionListener if (command == "send")
{
- System.out.println(message.getText());
output.append(message.getText() + "\n");
message.setText("");
}
|