private void addUserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addUserButtonActionPerformed


        //userTabList.removeAll(userTabList);
        //stores old tab-title
        String olduser = tabpanel_chathistory.getTitleAt(tabpanel_chathistory.getSelectedIndex());
        String newuser = (String) lbx_users_online.getModel().getElementAt(lbx_users_online.getSelectedIndex());

        if (olduser.contains(newuser) == false) {
            
            try{
            cl.out.writeUTF("[REQUEST]" + "[" + newuser + "]" + "[" + olduser + "]");
            cl.out.flush();
            } catch (IOException ex) {
                Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            //sets new title
            //tabpanel_chathistory.setTitleAt(tabpanel_chathistory.getSelectedIndex(), olduser + "," + newuser);
            //adds a new user to the TabList array to know where message belongs
            //userTabList.add(lbx_users_online.getModel().getElementAt(lbx_users_online.getSelectedIndex()).toString());
            //sorting the userTabList in ascending order
            Collections.sort(userTabList);
        }
        System.out.println(userTabList);
        System.out.println("[" + newuser + "]" +  olduser);
        //send to the chatter the new client for the tab
        
    }//GEN-LAST:event_addUserButtonActionPerformed