public void actionPerformed(ActionEvent e){
		Object o = e.getSource();
		if(o == logout){
			client.sendMessage(new ChatMessage(ChatMessage.LOGOUT, ""));
			return;
		}
		if(o == whoIsIn){
			client.sendMessage(new ChatMessage(ChatMessage.WHOISIN, ""));
			return;
		}
		if(connected){
			client.sendMessage(new ChatMessage(ChatMessage.MESSAGE, tf.getText()));
			tf.setText("");
			return;
		}
		if(o == login){
			String username = tf.getText().trim();
			if(username.length() == 0)
				return;
			String server = tfServer.getText().trim();
			if(server.length() == 0)
				return;
			String portNumber = tfPort.getText().trim();
			if(portNumber.length() == 0)
				return;
			int port = 0;
			try{
				port = Integer.parseInt(portNumber);
			}
			catch(Exception en){
				return;
			}
			client =  new Client(server, port, username, this);
			if(!client.start())
				return;
			tf.setText("");
			label.setText("Enter your message below");
			connected = true;
			
			login.setEnabled(false);
			logout.setEnabled(true);
			whoIsIn.setEnabled(true);
			tfServer.setEditable(false);
			tfPort.setEditable(false);
			tf.addActionListener(this);
		}
	}