public ClientConnection() {
		InetAddress serverAddress = null;
		try {
			serverAddress = InetAddress.getByName(addressToServer);
		} catch (UnknownHostException e1) {
			e1.printStackTrace();
		}
		try {
			connection.connect(serverAddress, remotePort);
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		Thread listener = new Thread() {
	        private String msg = "";
	        public void run() {
	            while (true) {
	            	try {
						msg = connection.receive();
						for (ActionListener listener : actionListeners) {
//							System.out.println("listeren triggered");
							listener.actionPerformed(new ActionEvent(ClientConnection.this, 0, msg)); //This is not nice, but whatever ^^
						}
					} catch (ConnectException e) {
						e.printStackTrace();
					} catch (IOException e) {
						e.printStackTrace();
					}
	            }
	        }
	    };
	    listener.start();
	}