@Override
	public void actionPerformed(ActionEvent e)
	{
		if (e.getSource() == conect)
		{
			/*NickWindow nick = new NickWindow();
			try
			{
				nick.start();
				nick.join();
			//	while (this.getClientNickName().equals("Default"))
				{
					//Thread.sleep(3000);
				}
			} catch (InterruptedException e1)
			{
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setClientNickName(nick.getNickName());*/
			//enter nick name
			ConnectionProxy proxy  = new ConnectionProxy();
			proxy.addConsumer(this);
			this.addConsumer(proxy);
			consumer.consume(new String (this.getClientNickName()));
			this.serverIP.setText(this.serverIP.getText()+proxy.getServerName());
			this.portNumber.setText(this.portNumber.getText()+ proxy.getPortNumber());
			proxy.start();
			
															// add the conection proxy to the string consumer conection
			// write code that will run when press the CONECT button
			System.out.println("CONECT Button Presed");
		}
		else if (e.getSource() == send ||e.getSource() == massageTextField )
		{
			// check if the user in conected
			if (consumer == null)
			{
				mainTextArea.append("you shall conect first"+"\n");
				massageTextField.setText("");
				return;
			}
			else
			{
				String newMassage = massageTextField.getText();
				massageTextField.setText("");
				System.out.println(newMassage);
				System.out.println("SEND Button Presed");
				consumer.consume(newMassage);
			}
			
			// write code that will run when press the SEND button
		}
	
	}