summaryrefslogtreecommitdiff
path: root/src/Client
diff options
context:
space:
mode:
authorDor Bivas <dor1_b@walla.com>2014-02-07 19:33:25 +0200
committerDor Bivas <dor1_b@walla.com>2014-02-07 19:33:25 +0200
commitee2b5c3ca486a3373d6170e9a8d86211951da930 (patch)
tree939725a6508b7e7777fd1442f76f6234b6d72d45 /src/Client
parenta838cac88d43a4fbcccce5afedb70c9c3e76ed34 (diff)
User Interface fixes and additions.
* Setting font for text box and output. * Output is now uneditable. * Removing debug prints of the UI commands.
Diffstat (limited to 'src/Client')
-rw-r--r--src/Client/UserInterface.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Client/UserInterface.java b/src/Client/UserInterface.java
index 1e898fc..1ab934f 100644
--- a/src/Client/UserInterface.java
+++ b/src/Client/UserInterface.java
@@ -1,5 +1,6 @@
package Client;
import java.awt.Color;
+import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
@@ -37,11 +38,14 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener
this.client = client;
+ Font font = new Font ("Ariel" , Font.BOLD ,12);
this.setIconImage(getIconImage());
this.setSize(800, 400);
output = new JTextArea(10, 20);
- output.setBackground(Color.gray);
+ output.setBackground(Color.green);
+ output.setFont(font);
+ output.setEditable(false);
JPanel msgPanel = new JPanel();
JPanel conPanel = new JPanel();
@@ -51,6 +55,8 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener
message = new JTextField(40);
message.addKeyListener(this);
+ message.setFont(font);
+ message.setForeground(Color.BLUE);
JButton stop = new JButton("Stop");
stop.setActionCommand("stop");
stop.addActionListener(this);
@@ -95,7 +101,6 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener
* @param name of the action */
public void actionPerformed(ActionEvent e)
{
- System.out.println(e.getActionCommand()); //FIXME: delete.
String command = e.getActionCommand();
if (command == "stop")
@@ -144,12 +149,12 @@ public class UserInterface extends JFrame implements ActionListener, KeyListener
System.exit(0);
}
- if ((e.getModifiers() & KeyEvent.ALT_DOWN_MASK) == 0 && e.getKeyChar() == KeyEvent.VK_C && counterClick == 0)
+ if ((e.getModifiers() & KeyEvent.ALT_DOWN_MASK) == 0 && e.getKeyChar() == KeyEvent.VK_C && counterClick == 0) //FIXME: ALT + SHIFT + C?...
{
output.append("You've connect to the server succesufully" + "\n");
counterClick++;
this.send.setEnabled(true);
- this.connect.setEnabled(false);
+ this.connect.setEnabled(false);
}