SComponent nameLabel = new SLabel(descriptor.getDisplayName()); editorPanel.add(nameLabel);
SComponent nameLabel = new SLabel(descriptor.getDisplayName()); Boolean mayBeNull = (Boolean)descriptor.getValue(MAYBENULL); if (mayBeNull != null && !mayBeNull.booleanValue()) { SPanel inner = new SPanel(); SLabel mark = new SLabel(" *"); mark.setForeground(Color.red); inner.add(nameLabel); inner.add(mark); editorPanel.add(inner); } else editorPanel.add(nameLabel);
    private void initComponents() {        editorPanel.removeAll();        PropertyDescriptor[] descriptors = getPropertyDescriptors();        for (int i = 0; i < descriptors.length; i++) {            PropertyDescriptor descriptor = descriptors[i];	    String name = descriptor.getDisplayName();	    Class type = descriptor.getPropertyType();	    Method getter = descriptor.getReadMethod();	    Method setter = descriptor.getWriteMethod();	    if (getter == null)		continue;            SPropertyEditor propertyEditor = getPropertyEditor(descriptor);            if (propertyEditor == null) {                System.err.println("no propertyEditor available for: " + name);                continue;            }	    propertyEditor.addPropertyChangeListener(this);	    EditorAdapter editorAdapter = (EditorAdapter)descriptor.getValue(EDITOR_ADAPTER);	    if (editorAdapter == null) {		if (setter == null)		    editorAdapter = new SLabelEditorAdapter();		else		    editorAdapter = getEditorAdapter(propertyEditor);	    }	    editorAdapter.setEditor(propertyEditor);            editorAdapter.init(descriptor);	    SComponent nameLabel = new SLabel(descriptor.getDisplayName());            editorPanel.add(nameLabel);            Boolean mayBeNull = (Boolean)descriptor.getValue(MAYBENULL);            if (mayBeNull == null || !mayBeNull.booleanValue()) {                SLabel editorMark = new SLabel(" * ");                editorMark.setForeground(Color.red);                SPanel innerPanel = new SPanel();                innerPanel.setLayout(new SBorderLayout());                innerPanel.add(editorAdapter.getComponent(), "Center");                innerPanel.add(editorMark, "East");                editorPanel.add(innerPanel);            }            else {                editorPanel.add(editorAdapter.getComponent());            }	    properties.put(name, new Property(descriptor, propertyEditor, editorAdapter));        }        if (getBean() != null)            readBean();    }