From 1c4577ec2824f9e4c9d678132a0d05065cfaca9c Mon Sep 17 00:00:00 2001 From: Dor Bivas Date: Sat, 22 Feb 2014 14:08:21 +0200 Subject: Client: Ui. * Auto scroll down when massage sent. * Wrapping text. --- src/Client/UserInterface.java | 8 ++++++-- 1 file 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()))) { -- cgit v1.2.3