Errors of adding GLJPanel to JPanel in NetBeans's GUI builder

Hi,
I use NetBeans 5.5 beta, Jogl beta5.
when I add a GLJPanel from jogl.jar to the NetBeans’s GUI builder palette, there are two errors:
o property GL:
java.lang.IllegalStateException: Error getting property value
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:866)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.InplaceEditorFactory.getInplaceEditor(InplaceEditorFactory.java:179)
at org.openide.explorer.propertysheet.InplaceEditorFactory.getInplaceEditor(InplaceEditorFactory.java:175)
at org.openide.explorer.propertysheet.SheetCellEditor.getEditorComponent(SheetCellEditor.java:145)
at org.openide.explorer.propertysheet.SheetCellEditor.getTableCellEditorComponent(SheetCellEditor.java:101)
at org.openide.explorer.propertysheet.BaseTable.prepareEditor(BaseTable.java:577)
at org.openide.explorer.propertysheet.SheetTable.prepareEditor(SheetTable.java:1162)
at javax.swing.JTable.editCellAt(JTable.java:3492)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at javax.media.opengl.GLJPanel.getContext(GLJPanel.java:714)
at javax.media.opengl.GLJPanel.getGL(GLJPanel.java:722)
at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:589)
at org.netbeans.modules.form.RADProperty.getTargetValue(RADProperty.java:73)
at org.netbeans.modules.form.FormProperty.checkCurrentValue(FormProperty.java:828)
at org.netbeans.modules.form.FormProperty.getValue(FormProperty.java:188)
at org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.java:879)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:851)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.InplaceEditorFactory.getInplaceEditor(InplaceEditorFactory.java:179)
at org.openide.explorer.propertysheet.InplaceEditorFactory.getInplaceEditor(InplaceEditorFactory.java:175)
at org.openide.explorer.propertysheet.SheetCellEditor.getEditorComponent(SheetCellEditor.java:145)
at org.openide.explorer.propertysheet.SheetCellEditor.getTableCellEditorComponent(SheetCellEditor.java:101)
at org.openide.explorer.propertysheet.BaseTable.prepareEditor(BaseTable.java:577)
at org.openide.explorer.propertysheet.SheetTable.prepareEditor(SheetTable.java:1162)
at javax.swing.JTable.editCellAt(JTable.java:3492)

o property autoSwapBufferMode:
java.lang.IllegalStateException: Error getting property value
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:866)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)

Yes, there have been reports of issues with the GLJPanel and NetBeans’s GUI builder. My recommendation would be to put a JPanel into your GUI and then change the code later to instantiate a GLJPanel instead.

Ken,

Is this a bug in NetBeans, or in JOGL, or both? Has a bug report been filed? Either way, the workaround you describe shouldn’t be necessary, and this should really be fixed at the source.

Thanks,
Chris

I suspect it’s mostly a bug in JOGL triggered by magic the NetBeans GUI builder is doing. I haven’t had the cycles to investigate exactly what’s going on though. At least one of the exceptions related to getGL()/setGL() being called by the GUI builder is probably the GUI builder’s assuming JavaBeans semantics for these methods when in reality they don’t have them. If you have contacts in the NetBeans GUI builder group I would be glad to work with them to investigate the root cause of the problems.

maybe providing a decent BeanInfo class for GLJPanel which does not declare the problematic setter/getter may do the trick. I suspect the autoSwapBufferMode error is caused by missing native libraries…
@Pegasus: whats the rest of the second stack trace?

It isn’t hard to cause exceptions in the Netbeans GUI builder without referencing any JOGL stuff. It’s actually quite unstable if you try anything non-trivial IMO.

java.lang.IllegalStateException: Error getting property value
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:866)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
==>
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:589)
at org.netbeans.modules.form.RADProperty.getTargetValue(RADProperty.java:73)
at org.netbeans.modules.form.FormProperty.checkCurrentValue(FormProperty.java:828)
at org.netbeans.modules.form.FormProperty.getValue(FormProperty.java:188)
at org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.java:879)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:851)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.getContext(GLJPanel.java:714)
at javax.media.opengl.GLJPanel.getGL(GLJPanel.java:722)
… 30 more
==>
java.lang.NullPointerException
at javax.media.opengl.GLJPanel.getContext(GLJPanel.java:714)
at javax.media.opengl.GLJPanel.getGL(GLJPanel.java:722)
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:589)
at org.netbeans.modules.form.RADProperty.getTargetValue(RADProperty.java:73)
at org.netbeans.modules.form.FormProperty.checkCurrentValue(FormProperty.java:828)
at org.netbeans.modules.form.FormProperty.getValue(FormProperty.java:188)
at org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.java:879)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:851)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

java.lang.IllegalStateException: Error getting property value
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:866)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
==>
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:589)
at org.netbeans.modules.form.RADProperty.getTargetValue(RADProperty.java:73)
at org.netbeans.modules.form.FormProperty.checkCurrentValue(FormProperty.java:828)
at org.netbeans.modules.form.FormProperty.getValue(FormProperty.java:188)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:841)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.getAutoSwapBufferMode(GLJPanel.java:743)
… 29 more
==>
java.lang.NullPointerException
at javax.media.opengl.GLJPanel.getAutoSwapBufferMode(GLJPanel.java:743)
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:589)
at org.netbeans.modules.form.RADProperty.getTargetValue(RADProperty.java:73)
at org.netbeans.modules.form.FormProperty.checkCurrentValue(FormProperty.java:828)
at org.netbeans.modules.form.FormProperty.getValue(FormProperty.java:188)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:841)
at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:791)
at org.openide.explorer.propertysheet.SheetTable.onCustomEditorButton(SheetTable.java:793)
at org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:660)
at java.awt.Component.processEvent(Component.java:5764)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4407)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4237)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
at java.awt.Container.dispatchEventImpl(Container.java:2028)
at java.awt.Window.dispatchEventImpl(Window.java:2405)
at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Due to the way the GLJPanel is implemented, the getGL()/setGL() and getAutoSwapBufferMode()/setAutoSwapBufferMode() methods definitely do not behave like normal “Java Beans” methods. I think it would be unfortunate if we had to add a public BeanInfo class for the GLJPanel and/or the GLCanvas at this late date in the specification but will consult with the NetBeans group and see what is necessary and possible.

Based on some feedback from the NetBeans group and our desire to avoid changing the public JSR-231 API I’ve added a couple of workarounds to the GLJPanel class for these exceptions. Could you please try a nightly build dated 6/20 or later and see whether things are working better?