@Override
	public void actionPerformed(ActionEvent action) {
		// TODO Auto-generated method stub

		// If click on button
		ipServer = txtIPServer.getText();
		String userName = txtUserName.getText().toString();
		int port = Integer.parseInt(txtPort.getText().toString());

		if(!checkPortAvailability(port)){
			txtPort.setText("");

		}else {
			System.out.println("Port Availability is ok");
			try {
				socket = new Socket(ipServer, portServer);
				out = new DataOutputStream(socket.getOutputStream());
				in = new DataInputStream(socket.getInputStream());

				out.writeUTF(Tags.START_SESSION + Tags.PEER_NAME_S + userName + Tags.PEER_NAME_E 
						+ Tags.PORT_S + port + Tags.PORT_E + Tags.END_SESSION);
				out.flush();

				String result = in.readUTF();

				ProtocolResultFromServer resultFromServer = Communicate.getProtocolResultFromServer(result);

				if(!resultFromServer.isAccept()){
					// TODO: show message box for user enter again
				}else{

					// ACCEPT -> new Main Form
					// shutdown sign in form
					setVisible(false);
					clientContacts = resultFromServer.getClientContacts();

					
					GUIMain gUIMain = new GUIMain(userName, clientContacts, out);
					gUIMain.setVisible(true);

					// start OnlineStatusKeepingHandler
					OnlineStatusKeepingHandler onlineStatusKeepingHandler = new OnlineStatusKeepingHandler(socket, userName, gUIMain);
					onlineStatusKeepingHandler.start();
					//start ServerSocket for listenning
					ClientListenerHandler listenThread = new ClientListenerHandler(socketListen, userName);
					listenThread.start();
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (JDOMException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (TagFormatException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}