This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
A simple program that creates a NetBeans property sheet using a BeanNode wrapper produces strange behavior when run independently from the IDE. 1. The editors like JFileCooser and String editor dialog cannot be closed with the cancel button 2. the editor dialog for indexed properties cannot be used at all (cannot create a new item) I haven't tried others like ColorChooser but I suppose there are problems with them too. I attach the sources for both the simple program (PTest2) and the bean (TestBean3). Execution environment is as follows: CLASSPATH: myclasses;openide-explorer.jar;openide-fs.jar;openide- nodes.jar;openide-util.jar;d:\java\netbeans\lib\core.jar; JDK=1.4.0 Sources: ////////////////////////////////////////////////// public class PTest2 extends JFrame { /** Creates a new instance of PTest2 */ public PTest2(String title) throws Exception { super(title); Container c = this.getContentPane(); TestBean3 testBean = new TestBean3(); final BeanNode bn = new BeanNode(testBean); final PropertySheet ps = new PropertySheet(); c.add(ps); this.setSize(300, 400); this.setVisible(true); SwingUtilities.invokeLater(new Runnable() { public void run() { ps.setNodes(new Node[] { bn } ); } }); } public static void main(String[] args) throws Exception { System.out.println("instantiate..."); java.beans.PropertyEditor pe = java.beans.PropertyEditorManager.findEditor (java.lang.Byte.TYPE); // this must be placed after the call to findEditor, otherwise // the primitive editors does not get loaded (oddly enough for me :) java.beans.PropertyEditorManager.setEditorSearchPath( new String[] { "org.netbeans.beaninfo.editors", // NOI18N "org.openide.explorer.propertysheet.editors" }); // NOI18N ///Class.forName ("org.netbeans.beaninfo.editors.ByteEditor").newInstance(); System.out.println("-ok"); new PTest2("Test"); } } //////////////////////////////////////////////// import java.beans.*; import java.io.*; /** * * @author jani */ public class TestBean3 extends Object implements java.io.Serializable { private static final String PROP_SAMPLE_PROPERTY = "SampleProperty"; private String sampleProperty; private PropertyChangeSupport propertySupport; /** Holds value of property freeTimeActivity. */ private String[] freeTimeActivity; /** Creates new TestBean3 */ public TestBean3() { propertySupport = new PropertyChangeSupport( this ); } public String getSampleProperty() { return sampleProperty; } public void setSampleProperty(String value) { String oldValue = sampleProperty; sampleProperty = value; propertySupport.firePropertyChange (PROP_SAMPLE_PROPERTY, oldValue, sampleProperty); } public void addPropertyChangeListener (PropertyChangeListener listener) { propertySupport.addPropertyChangeListener (listener); } public void removePropertyChangeListener (PropertyChangeListener listener) { propertySupport.removePropertyChangeListener (listener); } /** Indexed getter for property freeTimeActivity. * @param index Index of the property. * @return Value of the property at <CODE>index</CODE>. */ public String getFreeTimeActivity(int index) { return this.freeTimeActivity[index]; } /** Getter for property freeTimeActivity. * @return Value of property freeTimeActivity. */ public String[] getFreeTimeActivity() { return this.freeTimeActivity; } /** Indexed setter for property freeTimeActivity. * @param index Index of the property. * @param freeTimeActivity New value of the property at <CODE>index</CODE>. */ public void setFreeTimeActivity(int index, String freeTimeActivity) { this.freeTimeActivity[index] = freeTimeActivity; } /** Setter for property freeTimeActivity. * @param freeTimeActivity New value of property freeTimeActivity. */ public void setFreeTimeActivity(String[] freeTimeActivity) { this.freeTimeActivity = freeTimeActivity; } private File file; /** Holds value of property isPressed. */ private boolean isPressed; public File getFile() { return this.file; } public void setFile(File file) { this.file = file; } /** Getter for property isPressed. * @return Value of property isPressed. */ public boolean isIsPressed() { return this.isPressed; } /** Setter for property isPressed. * @param isPressed New value of property isPressed. */ public void setIsPressed(boolean isPressed) { this.isPressed = isPressed; } } ////////////////////////////////////////////////
*** This issue has been marked as a duplicate of 26013 ***
verified, closed - it's duplicate.