String init = editor.getAsText();
    synchronized void setTarget(Object targ) {        //System.out.println("Enter>        // PropertySheetPanel.setTarget()");        // We make the panel invisible during the reconfiguration        // to try to reduce screen flicker.        setVisible(false);        removeAll();        targetBean = targ;        try {            BeanInfo bi = Introspector.getBeanInfo(targetBean.getClass());            properties = bi.getPropertyDescriptors();        } catch (IntrospectionException ex) {            error("GenericPropertySheet: Couldn't introspect", ex);            return;        }        editors = new PropertyEditor[properties.length];        values = new Object[properties.length];        views = new Component[properties.length];        labels = new JLabel[properties.length];        int numEditorsToDisplay = 0;        for (int i = 0; i < properties.length; i++) {            String name = properties[i].getDisplayName();            // Don't display hidden or expert properties.            if (properties[i].isHidden() || properties[i].isExpert()) {                System.out.println("Ignoring hidden or expert property " + name);                continue;            }            Class type = properties[i].getPropertyType();            Method getter = properties[i].getReadMethod();            Method setter = properties[i].getWriteMethod();            // Only display read/write properties.            if ((getter == null) || (setter == null)) {                System.out.println("Ignoring read-only/write-only property "                        + name);                continue;            }            Component view = null;            try {                Object args[] = {};                Object value = getter.invoke(targetBean, args);                values[i] = value;                PropertyEditor editor = null;                Class pec = properties[i].getPropertyEditorClass();                if (pec != null) {                    try {                        editor = (PropertyEditor) pec.newInstance();                    } catch (Exception ex) {                        // Drop through.                        System.out.println("Cannot instanciate editor class: "                                + pec);                        System.out.println("Will try to find editor using "                                + "PropertyEditorManager");                    }                }                if (editor == null)                    editor = PropertyEditorManager.findEditor(type);                editors[i] = editor;                // If we can't edit this component, skip it.                if (editor == null) {                    // If it's a user-defined property we give a                    // warning.                    String getterClass = properties[i].getReadMethod()                            .getDeclaringClass()                            .getName();                    if (getterClass.indexOf("java.") != 0)                        System.err.println("Warning: Can't find public property editor for property \""                                + name + "\".  Skipping.");                    continue;                }                //System.out.println("About to set value " + value);                editor.setValue(value);                editor.addPropertyChangeListener(_frame);                // Now figure out how to display it...                if (editor.isPaintable() && editor.supportsCustomEditor())                    view = new PropertyCanvas(_frame, editor);                else if (editor.getTags() != null)                    view = new PropertySelector(editor);                else if (editor.getAsText() != null) {                    String init = editor.getAsText();                    view = new PropertyText(editor);                } else {                    System.err.println("Warning: Property \"" + name                            + "\" has non-displayabale editor. Skipping.");                    continue;                }                if (editor instanceof GenericPropertyEditorInterface)                    ((GenericPropertyEditorInterface) editor).setTargetBean(targetBean);            } catch (InvocationTargetException ex) {                System.err.println("Skipping property " + name                        + " ; exception on target: " + ex.getTargetException());                ex.getTargetException().printStackTrace();                continue;            } catch (Exception ex) {                System.err.println("Skipping property " + name                        + "; exception: " + ex);                ex.printStackTrace();                continue;            }            labels[i] = new JLabel(name, JLabel.LEFT);            views[i] = view;            numEditorsToDisplay++;        } // end for        this.setLayout(new GridLayout(numEditorsToDisplay, 2));        for (int i = 0; i < properties.length; i++)            if (views[i] != null) {                add(labels[i]);                add(views[i]);            }        _frame.setNumEditorsToDisplay(numEditorsToDisplay);        _frame.setFrameSize();        processEvents = true;        setVisible(true);        //System.out.println("Exit> PropertySheetPanel.setTarget()");    } // end setTarget