@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        txt_sendingField = new javax.swing.JTextField();
        cmd_send = new javax.swing.JButton();
        tabpanel_chathistory = new javax.swing.JTabbedPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        txt_chatHistory = new javax.swing.JTextArea();
        jScrollPane1 = new javax.swing.JScrollPane();
        lbx_users_online = new javax.swing.JList();
        txt_username = new javax.swing.JTextField();
        txt_password = new javax.swing.JPasswordField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        cmd_connect = new javax.swing.JButton();
        cmd_disconnect = new javax.swing.JButton();
        cmd_regNewUser = new javax.swing.JButton();
        addUserButton = new javax.swing.JButton();
        chk_user = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Awesome Chatclient");
        setBounds(new java.awt.Rectangle(400, 200, 483, 300));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        txt_sendingField.setText("Enter message here...");
        txt_sendingField.setToolTipText("");
        txt_sendingField.setEnabled(false);
        txt_sendingField.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txt_sendingFieldFocusGained(evt);
            }
        });
        txt_sendingField.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                txt_sendingFieldPropertyChange(evt);
            }
        });

        cmd_send.setText("send!");
        cmd_send.setToolTipText("");
        cmd_send.setEnabled(false);
        cmd_send.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmd_sendActionPerformed(evt);
            }
        });

        tabpanel_chathistory.setEnabled(false);

        txt_chatHistory.setColumns(20);
        txt_chatHistory.setEditable(false);
        txt_chatHistory.setRows(5);
        txt_chatHistory.setEnabled(false);
        jScrollPane2.setViewportView(txt_chatHistory);

        tabpanel_chathistory.addTab("Chat", jScrollPane2);

        lbx_users_online.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "stefan", "stefan2", "stefan3", "User 1", "User 2", "User 3", "User 4", "User 5", "User 6", "User 7" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        lbx_users_online.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        lbx_users_online.setEnabled(false);
        lbx_users_online.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbx_users_onlineMouseClicked(evt);
            }
        });
        lbx_users_online.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                lbx_users_onlineValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(lbx_users_online);

        jLabel1.setText("Password:");

        jLabel2.setText("Username:");

        cmd_connect.setText("connect...");
        cmd_connect.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cmd_connectMouseClicked(evt);
            }
        });
        cmd_connect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmd_connectActionPerformed(evt);
            }
        });

        cmd_disconnect.setText("disconnect...");
        cmd_disconnect.setToolTipText("");
        cmd_disconnect.setEnabled(false);
        cmd_disconnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmd_disconnectActionPerformed(evt);
            }
        });

        cmd_regNewUser.setText("Register new user");
        cmd_regNewUser.setToolTipText("");
        cmd_regNewUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmd_regNewUserActionPerformed(evt);
            }
        });

        addUserButton.setActionCommand("cmd_addUser");
        addUserButton.setEnabled(false);
        addUserButton.setLabel("+");
        addUserButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addUserButtonActionPerformed(evt);
            }
        });

        chk_user.setText("Show offline users");
        chk_user.setToolTipText("switch on / offline user");
        chk_user.setActionCommand("chk_offline_user");
        chk_user.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                chk_userStateChanged(evt);
            }
        });
        chk_user.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chk_userActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(tabpanel_chathistory)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(txt_sendingField, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmd_send)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(cmd_connect, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cmd_disconnect, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
                    .addComponent(txt_password, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txt_username, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(addUserButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmd_regNewUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(chk_user, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tabpanel_chathistory)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 19, Short.MAX_VALUE)
                        .addComponent(jLabel2)
                        .addGap(2, 2, 2)
                        .addComponent(txt_username, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel1)
                        .addGap(2, 2, 2)
                        .addComponent(txt_password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmd_connect)
                            .addComponent(cmd_disconnect))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(4, 4, 4)
                .addComponent(chk_user)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_sendingField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cmd_send)
                    .addComponent(cmd_regNewUser)
                    .addComponent(addUserButton))
                .addGap(4, 4, 4))
        );

        tabpanel_chathistory.getAccessibleContext().setAccessibleName("Chat");
        tabpanel_chathistory.getAccessibleContext().setAccessibleDescription("");

        pack();
    }// </editor-fold>//GEN-END:initComponents