ClientGUI(String host, int port) {

        super("jChat Client (Build " + Client.clientVer + " -- https://www.github.com/ipavl/javachat)");

        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(590, 480);
        setResizable(false);
        getContentPane().setLayout(null);

        JLabel lblServer = new JLabel("Server:");
        lblServer.setBounds(10, 11, 46, 14);
        getContentPane().add(lblServer);

        txtServer = new JTextField();
        txtServer.setText("localhost");   // TODO: Save user-set host on disconnect
        txtServer.setBounds(58, 8, 91, 20);
        txtServer.setColumns(10);
        getContentPane().add(txtServer);

        JLabel lblPort = new JLabel(":");
        lblPort.setBounds(153, 11, 4, 14);
        getContentPane().add(lblPort);

        txtPort = new JTextField();
        txtPort.setText("1500");
        txtPort.setBounds(159, 8, 40, 20);
        txtPort.setColumns(10);
        getContentPane().add(txtPort);

        btnConnect = new JButton("Connect");
        btnConnect.setBounds(267, 7, 89, 23);
        btnConnect.addActionListener(this);
        getContentPane().add(btnConnect);

        btnDisconnect = new JButton("Disconnect");
        btnDisconnect.setEnabled(false);
        btnDisconnect.setBounds(366, 7, 109, 23);
        btnDisconnect.addActionListener(this);
        getContentPane().add(btnDisconnect);

        btnUserlist = new JButton("Userlist");
        btnUserlist.setEnabled(false);
        btnUserlist.setBounds(485, 7, 89, 23);
        btnUserlist.addActionListener(this);
        getContentPane().add(btnUserlist);

        txtMessage = new JTextField();
        txtMessage.setText("Click here to set your login credentials.");
        txtMessage.setBounds(0, 423, 584, 29);
        txtMessage.setColumns(10);

        txtMessage.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                if(!connected && e.getButton() == MouseEvent.BUTTON1) {
                    // Open login window
                    LoginDialog loginDlg = new LoginDialog(frame);
                    loginDlg.setVisible(true);

                    // Get username from login dialog
                    if (loginDlg.getUsername().length() != 0) {
                        username = loginDlg.getUsername();
                        // Get and hash password from login dialog
                        try {
                            password = AeSimpleSHA1.SHA1(loginDlg.getPassword());
                        } catch (NoSuchAlgorithmException e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        } catch (UnsupportedEncodingException e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        }
                        append("Set username to: " + username + "\n");
                    }
                }
            }
        });

        txtMessage.addKeyListener(new KeyAdapter() {	// set username when not connected
            @Override
            public void keyPressed(KeyEvent e) {
                if(!connected && e.getKeyCode() == KeyEvent.VK_ENTER) {
                    String msg = txtMessage.getText();
                    // empty message ignore it
                    if(msg.length() == 0)
                        return;
                    username = msg;
                    txtMessage.setText("");
                    append("Set username to: " + username + "\n");
                    return;
                }
            }
        });

        getContentPane().add(txtMessage);

        scrollPane = new JScrollPane();
        scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        scrollPane.setBounds(0, 36, 584, 383);
        getContentPane().add(scrollPane);

        lstChat = new JTextArea("", 0, 0);
        lstChat.setEditable(false);
        scrollPane.setViewportView(lstChat);
        lstChat.setLineWrap(true);
        setVisible(true);

    }