diff options
author | Dor Bivas <dor1_b@walla.com> | 2014-02-22 14:08:21 +0200 |
---|---|---|
committer | Dor Bivas <dor1_b@walla.com> | 2014-02-22 14:08:21 +0200 |
commit | 1c4577ec2824f9e4c9d678132a0d05065cfaca9c (patch) | |
tree | a675466ddb99ee0cadf44bd7387bfefa6acd9aca | |
parent | 3abd457e7c58f8d39f27ce4868b652b5d58572ff (diff) |
Client: Ui.
* Auto scroll down when massage sent.
* Wrapping text.
-rw-r--r-- | src/Client/UserInterface.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Client/UserInterface.java b/src/Client/UserInterface.java index 22a7b8e..973e4d4 100644 --- a/src/Client/UserInterface.java +++ b/src/Client/UserInterface.java @@ -38,6 +38,7 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener output.append("me: " + message.getText() + "\n"); client.PRIVMSG(message.getText()); message.setText(""); + output.setCaretPosition(output.getText().length()); } private void msgConnectRun () @@ -62,6 +63,9 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener output.setBackground(Color.green); output.setFont(font); output.setEditable(false); + output.setLineWrap(true); + output.setWrapStyleWord(true); + JPanel msgPanel = new JPanel(); JPanel conPanel = new JPanel(); @@ -130,12 +134,12 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener System.exit(0); } - if (command == "send" ) + if (command == "send") { msgSendRun(); } - if (command == "connect" && counterClick == 0 ) + if (command == "connect" && counterClick == 0) { if (client.connect(host.getText(),Integer.parseInt(port.getText()))) { |