private void initConnection() throws UnknownHostException, IOException {
        System.out.println("init connection");
        connection = new ChatConnection("localhost", 3191);
        connection.addObserver(this);
        Thread t = new Thread(connection);
        t.start();
        changeUsernameMenuItemActionPerformed(null);
        statusBarLabel.setText("Connected to " + connection.getHost() + " as " + connection.getSelf().getName());
    }