private void jBCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCadastrarActionPerformed
            if(jTEmailCadastro.getText().contains("@") && !jTEmailCadastro.getText().contains(" ") && jTEmailCadastro.getText().contains(".")){
        try {
            // TODO add your handling code here:
          
            Socket socket = new Socket("localhost", 10001);
            String emailCadastro = jTEmailCadastro.getText();
            
            byte b[] = null;
            User user = new User();
            user.setEmail(emailCadastro);
            
            String codigo = StringByte.convertByteString(ConvertUser.ObjXml(user), "CAD;");
            
            b = StringByte.convertStringByte(codigo);
            
            socket.getOutputStream().write(b);
            socket.getOutputStream().flush();
            
            InputStream input = socket.getInputStream();
            ByteArrayOutputStream temp = new ByteArrayOutputStream();
            byte[] msg = new byte[1];
            
            while(input.read(msg) != -1){
                temp.write(msg);
            }
        
            String mensagem = temp.toString();
            JOptionPane.showMessageDialog(null, mensagem);
            
        } catch (IOException | JAXBException ex) {
            Logger.getLogger(Inicio.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        }else{
            JOptionPane.showMessageDialog(null, "Email invalido!");
        }
        
            jTEmailCadastro.setText("");
    }//GEN-LAST:event_jBCadastrarActionPerformed