private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
        if(evt.getButton() == 1){
            jTextField2.setEnabled(true);
            jTextArea1.setEnabled(true);
            jTextArea2.setEnabled(true);
            jTextArea3.setEnabled(true);
            
            if(sslclientSocket == null)
            {
                try{
                    sslclientSocket = new ClientSocket(jTextField3.getText(), Integer.parseInt(jTextField4.getText()));
                    sslclientSocket.sendMessage(BP01.sUsername);
                    try {
                        userList = (ArrayList<String>) new ObjectInputStream(sslclientSocket.getClient().getInputStream()).readObject();
                        System.out.println("object recieved");
                        for(String s : userList)
                            jTextArea3.append(s);
                    } catch (IOException | ClassNotFoundException ex) {
                        Logger.getLogger(BPMain.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    jLabel9.setForeground(new Color(51, 153, 0));
                }catch(NumberFormatException e){
                    jLabel9.setForeground(new Color(153, 51, 0));
                    chatUpdating = false;
                    jTextArea1.setEnabled(false);
                    jTextArea1.setEnabled(false);
                    jTextArea1.setEnabled(false);
                    jTextField2.setEnabled(false);
                    sslclientSocket = null;
                }finally{
                    if(!chatUpdate.isAlive())
                        chatUpdate.start();
                    if(sslclientSocket != null)
                    {
                        jTextArea1.setEnabled(true);
                        jTextArea1.setEnabled(true);
                        jTextArea1.setEnabled(true);
                        jTextField2.setEnabled(true);
                        chatUpdating = true;
                    }
                }
            }
            jLabel4.dispatchEvent(new MouseEvent(jPanel1.getComponentAt(172, 71),
                               MouseEvent.MOUSE_CLICKED,
                               System.currentTimeMillis(),
                               MouseEvent.NOBUTTON,
                               172,71,
                               1,
                               false));
       }
    }//GEN-LAST:event_jButton2MouseClicked