private void initialize() {

		try {
			if (socket == null) {
				statusMessage("Connecting to server...");
				socket = new Socket(Parameters.SERVER, Parameters.port);
			}
		} catch (UnknownHostException e) {
			System.out.println("Error trying to connect to host");
			statusMessage("Unable to reach server");
			this.errorCloseClient("Unable to reach server");
			e.printStackTrace();
			return;
		} catch (IOException e) {
			System.out.println("Error trying to connect to host");
			statusMessage("Unable to reach server");
			this.errorCloseClient("Unable to reach server");
			e.printStackTrace();
			return;
		}

		try {
			System.out.println("Getting outputstream to server");
			out = new ObjectOutputStream(socket.getOutputStream());
			System.out.println("getting outputstream to server successful");
		} catch (IOException e) {
			System.out.println("Error trying to get output stream");
			e.printStackTrace();
		}
		try {
			System.out.println("Getting inputstream from server");
			in = new ObjectInputStream(socket.getInputStream());
			System.out.println("getting inputstream from server successful");
		} catch (IOException e) {
			System.out.println("Error trying to get input stream");
			e.printStackTrace();
		}

		statusMessage("Connection successful!");
		isOpen = true;
		
		hasConnected();
	}