public static void Connect()
	{
		try
		{
			final int port = 6066;
			final String hostName = "localhost";
			
			Socket clientSocket = new Socket(hostName, port);
			System.out.println("You connected to: " + hostName);
						
			chatClient = new Client(clientSocket);
			PrintWriter output = new PrintWriter(clientSocket.getOutputStream());
			System.out.println("username sent to server");
			output.println(userName);
			output.flush();
			
			loginWindow.setVisible(false);
			mainWindow.setVisible(true);
			
			Thread clientThread = new Thread(chatClient);
			clientThread.start();
		}
		catch (Exception e)
		{
			System.out.println("error in connect from clientgui");
			JOptionPane.showMessageDialog(null, "Server not responding");
			e.printStackTrace();
			System.exit(0);
		}
	}