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.
[#200304242350; jdk1.4.2 beta 20] 1.Run IDE and create new JFrame Form 2.Add the AWT ScrollPane into this form 3.Exception will pop up This behaviour is doesn't appear when I use previous version of jdk(1.4.1_02). See stacktrace below. Annotation: Invalid value. The property scrollPosition could not be set. Reason: null java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.netbeans.modules.form.RADProperty.getTargetValue (RADProperty.java:75) at org.netbeans.modules.form.FormProperty.checkCurrentValue (FormProperty.java:802) at org.netbeans.modules.form.FormProperty.getValue (FormProperty.java:183) at org.openide.explorer.propertysheet.PropertyPanel$SimpleMode l.getValue(PropertyPanel.java:1467) at org.openide.explorer.propertysheet.PropertyPanel.updateEdit or(PropertyPanel.java:686) at org.openide.explorer.propertysheet.PropertyPanel.<init> (PropertyPanel.java:284) at org.openide.explorer.propertysheet.PropertyPanel.<init> (PropertyPanel.java:290) at org.openide.explorer.propertysheet.PropertySheetTab.fillPro perties(PropertySheetTab.java:290) at org.openide.explorer.propertysheet.PropertySheetTab.createP ane(PropertySheetTab.java:238) at org.openide.explorer.propertysheet.PropertySheetTab.ensureP aneCreated(PropertySheetTab.java:193) at org.openide.explorer.propertysheet.PropertySheet.navToCorre ctPage(PropertySheet.java:593) at org.openide.explorer.propertysheet.PropertySheet.setCurrent Node(PropertySheet.java:621) at org.openide.explorer.propertysheet.PropertySheet.access$900 (PropertySheet.java:53) at org.openide.explorer.propertysheet.PropertySheet$3.run (PropertySheet.java:271) at java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:178) at java.awt.EventQueue.dispatchEvent (EventQueue.java:454) at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:151) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:137) at java.awt.EventDispatchThread.run (EventDispatchThread.java:100) Caused by: java.lang.NullPointerException: child is null at java.awt.ScrollPane.getScrollPosition (ScrollPane.java:359) [catch] ... 25 more ==> java.lang.NullPointerException: child is null at java.awt.ScrollPane.getScrollPosition (ScrollPane.java:359) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.netbeans.modules.form.RADProperty.getTargetValue (RADProperty.java:75) at org.netbeans.modules.form.FormProperty.checkCurrentValue (FormProperty.java:802) at org.netbeans.modules.form.FormProperty.getValue (FormProperty.java:183) at org.openide.explorer.propertysheet.PropertyPanel$SimpleMode l.getValue(PropertyPanel.java:1467) at org.openide.explorer.propertysheet.PropertyPanel.updateEdit or(PropertyPanel.java:686) at org.openide.explorer.propertysheet.PropertyPanel.<init> (PropertyPanel.java:284) at org.openide.explorer.propertysheet.PropertyPanel.<init> (PropertyPanel.java:290) at org.openide.explorer.propertysheet.PropertySheetTab.fillPro perties(PropertySheetTab.java:290) at org.openide.explorer.propertysheet.PropertySheetTab.createP ane(PropertySheetTab.java:238) at org.openide.explorer.propertysheet.PropertySheetTab.ensureP aneCreated(PropertySheetTab.java:193) at org.openide.explorer.propertysheet.PropertySheet.navToCorre ctPage(PropertySheet.java:593) at org.openide.explorer.propertysheet.PropertySheet.setCurrent Node(PropertySheet.java:621) at org.openide.explorer.propertysheet.PropertySheet.access$900 (PropertySheet.java:53) [catch] at org.openide.explorer.propertysheet.PropertySheet$3.run (PropertySheet.java:271) at java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:178) at java.awt.EventQueue.dispatchEvent (EventQueue.java:454) at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:151) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:137) at java.awt.EventDispatchThread.run (EventDispatchThread.java:100)
Will check the difference between jdk 1.4.2 and 1.4.1.
*** Issue 35093 has been marked as a duplicate of this issue. ***
*** Issue 35082 has been marked as a duplicate of this issue. ***
Basically caused indirectly by fix of 4810551 in JDK 1.4.2. java.beans.Introspector now checks whether BeanInfo class found on search path belongs to the bean class whose BeanInfo is searched for. Unfortunately, this check does not pass if the BeanInfo does not provide any descriptors (BeanDescriptor, PropertyDescriptor, etc) that could be used for checking. That's also the case of ScrollPaneBeanInfo provided by form module - Introspector is not sure if it really belongs to java.awt.ScrollPane so it is refused and uses reflection to scan ScrollPane class. This way it recognizes also get/setScrollPosition as property - which cannot be used as property because the getter behaves incorrectly (for property getter) - throws NPE if no component is in the scroll pane.
Fixed in dev trunk. Added BeanDescriptor to all BeanInfo classes. Applied also to prj40_prototype branch.
Created attachment 11843 [details] patch for NB 3.5.x
To use the patch, create org-netbeans-modules-form directory in your $nb_install$/modules/patches and place the patch jar file in there.
Verified in both: -3.5 with the patch -NetBeansIDE-dev-200310140100