public void exploreBean(DefaultMutableTreeNode root, String classname, String parentPath) {
    try {

      root.removeAllChildren();
      if (parentPath.length() > 0) parentPath += ".";

      MainFrame.reportClassLoader.rescanLibDirectory();
      Class clazz = Class.forName(classname, true, MainFrame.reportClassLoader);

      java.beans.PropertyDescriptor[] pd =
          org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptors(clazz);
      for (int nd = 0; nd < pd.length; ++nd) {
        String fieldName = pd[nd].getName();
        if (pd[nd].getPropertyType() != null && pd[nd].getReadMethod() != null) {
          String returnType = pd[nd].getPropertyType().getName();
          it.businesslogic.ireport.JRField field =
              new it.businesslogic.ireport.JRField(Misc.getJRFieldType(fieldName), returnType);
          if (isPathOnDescription()) {
            field.setDescription(parentPath + fieldName);
          } else {
            field.setName(parentPath + fieldName);
          }

          TreeJRField jtf = new TreeJRField();

          jtf.setField(field);
          jtf.setObj(pd[nd].getPropertyType());

          boolean bChildrens = true;
          if (pd[nd].getPropertyType().isPrimitive()
              || pd[nd].getPropertyType().getName().startsWith("java.lang.")) {
            bChildrens = false;
          }
          root.add(new DefaultMutableTreeNode(jtf, bChildrens));
        }
      }

      jTree1.expandPath(new TreePath(root.getPath()));
      jTree1.updateUI();

    } catch (ClassNotFoundException cnf) {
      javax.swing.JOptionPane.showMessageDialog(
          this,
          I18n.getFormattedString(
              "messages.BeanInspectorPanel.classNotFoundError",
              "Class not found error!!\nCheck your classpath and retry!\n{0}",
              new Object[] {cnf.getMessage()}),
          I18n.getString("message.title.error", "Error"),
          javax.swing.JOptionPane.ERROR_MESSAGE);
      return;
    } catch (Exception ex) {
      javax.swing.JOptionPane.showMessageDialog(
          this,
          ex.getMessage(),
          I18n.getString("message.title.error", "Error"),
          javax.swing.JOptionPane.ERROR_MESSAGE);
      return;
    }
  }
  private void jButton2ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed

    // Get all selected paths...
    if (MainFrame.getMainInstance().getActiveReportFrame() == null || getJTableFields() == null) {
      return;
    }

    DefaultTableModel dtm = (DefaultTableModel) getJTableFields().getModel();

    TreePath[] paths = jTree1.getSelectionPaths();
    if (paths == null) return;
    for (int i = 0; i < paths.length; ++i) {
      boolean valid = true;
      TreePath tp = paths[i];

      TreeJRField tjrf =
          (TreeJRField) ((DefaultMutableTreeNode) tp.getLastPathComponent()).getUserObject();
      String returnType = Misc.getJRFieldType(tjrf.getObj().getName());
      it.businesslogic.ireport.JRField field =
          new it.businesslogic.ireport.JRField(tjrf.getField().getName(), returnType);
      field.setDescription(tjrf.getField().getDescription());
      Vector row = new Vector();
      row.addElement(field);
      row.addElement(field.getClassType());
      row.addElement(field.getDescription());

      if (isComboVisible() && jComboBox1.getSelectedItem() instanceof FieldClassWrapper) {
        FieldClassWrapper cw = (FieldClassWrapper) jComboBox1.getSelectedItem();
        field.setName(cw.getFieldName() + "." + field.getDescription());
        field.setDescription(field.getName());
      }

      // Check for duplicates fields...
      boolean found = fieldAlreadyExists(field);
      String baseName = field.getName();
      for (int j = 1; isPathOnDescription() && found; ++j) {
        field.setName(baseName + "_" + j);
        found = fieldAlreadyExists(field);
      }

      if (!found) {
        dtm.addRow(row);
        getJTableFields()
            .getSelectionModel()
            .addSelectionInterval(
                getJTableFields().getRowCount() - 1, getJTableFields().getRowCount() - 1);
      }
    }
  } // GEN-LAST:event_jButton2ActionPerformed