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.
dev 030402. Run with -ui com.sun.java.swing.plaf.gtk.GTKLookAndFeel under 1.4.2b19. In Explorer, browse to the class node beneath a Java source node. An exception is thrown.
Created attachment 9709 [details] Stack trace
Probably also occurs in 3.5, please check.
Having fixed issue 32633 (popup menu), I find this also occurs when you choose Add Field from the fields node of a class. I added some logging to ModifiersEditor, before the line where the NPE occurs. Results: support = null PCL = com.sun.java.swing.plaf.gtk.SynthPanelUI@1c8e807 Thread= Thread[AWT-EventQueue-0,6,IDE Main] support - an instance of PropertyChangeSupport is null. The only code that sets the value of support is the second line of the constructor. What is weird about this is that it appears the constructor simply never runs for this class (tried adding while (support == null) {} to addPropertyChangeListener - the result was an endless loop - so it's not just getting called before the constructor completes).
Look at the stack trace. addPropertyChangeListener is being called from the super constructor, before the fields have been initialized. Component.addPCL implements this correctly, but ModifierEditor does not. Recommended fix: patch ModifierEditor to remove the addPCL and removePCL methods, since the superclass already defines them perfectly well. Replace support.firePropertyChange(...) with firePropertyChange(...).
*** This issue has been marked as a duplicate of 32682 ***
Reorganization of java component
v/c