Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6614419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:20:13+00:00 2026-05-25T20:20:13+00:00

Recently, I got a weird stack trace in the netbeans logs (I added it

  • 0

Recently, I got a weird stack trace in the netbeans logs (I added it to the end of this post). I was able to track it down to the LAF. This error happens, when running Netbeans using the GTK LAF, but works fine in Metal, and using the native Windows LAF.

It seems, that the PropertyChangeSupport instance is NULL, so it throws an error when adding a Property change listener. Here’s the abbreviated source of my custom component:

public class EnterprisePicker extends javax.swing.JPanel implements ActionListener, KeyListener, ListSelectionListener, UnitContainer {

    private static final Logger logger = IdeUiUtil.initLogger(EnterprisePicker.class.getName());
    protected InfoPanelStyle infoPanelStyle = InfoPanelStyle.FULL;
    private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
    public static final String PROP_INFOPANELSTYLE = "infoPanelStyle";

    /** Creates the new component */
    public EnterprisePicker() {
        // [... snip ...]
    }

    // [ ... snip ... ]

    /**
     * Add PropertyChangeListener.
     *
     * @param listener
     */
    @Override
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.addPropertyChangeListener(listener);
    }

    // [ ... snip ... ]

}

Obviously I could simply protect these calls using if (propertyChangeSupport == null)… But would that not break properties later on in the application? Assuming that no listener will ever be attached as the instance is null…?

Stack Trace

INFO [org.netbeans.modules.form.BeanSupport]: Cannot create default instance of: org.statec.ide.ui.components.EnterprisePicker
java.lang.NullPointerException
        at org.statec.ide.ui.components.EnterprisePicker.addPropertyChangeListener(EnterprisePicker.java:654)
        at javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:49)
        at javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:38)
        at javax.swing.JComponent.setUI(JComponent.java:662)
        at javax.swing.JPanel.setUI(JPanel.java:136)
        at javax.swing.JPanel.updateUI(JPanel.java:109)
        at javax.swing.JPanel.<init>(JPanel.java:69)
        at javax.swing.JPanel.<init>(JPanel.java:92)
        at javax.swing.JPanel.<init>(JPanel.java:100)
        at org.statec.ide.ui.components.EnterprisePicker.<init>(EnterprisePicker.java:39)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:168)
[catch] at org.netbeans.modules.form.BeanSupport.createBeanInstance(BeanSupport.java:83)
        at org.netbeans.modules.form.BeanSupport.getDefaultInstance(BeanSupport.java:109)
        at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:769)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:1007)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:527)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:299)
        at org.netbeans.modules.form.FormEditor$3.run(FormEditor.java:337)
        at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
        at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
        at org.openide.util.Mutex.readAccess(Mutex.java:320)
        at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
        at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:334)
        at org.netbeans.modules.form.FormEditor.loadFormDesigner(FormEditor.java:232)
        at org.netbeans.modules.form.FormDesigner.finishComponentShowing(FormDesigner.java:1932)
        at org.netbeans.modules.form.FormDesigner.access$1100(FormDesigner.java:107)
        at org.netbeans.modules.form.FormDesigner$PreLoadTask$1.run(FormDesigner.java:1897)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
INFO
org.openide.ErrorManager$AnnException: msg
        at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:866)
        at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
        at org.netbeans.modules.form.GandalfPersistenceManager.annotateException(GandalfPersistenceManager.java:237)
        at org.netbeans.modules.form.GandalfPersistenceManager.annotateException(GandalfPersistenceManager.java:247)
        at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:865)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:1007)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:527)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:299)
        at org.netbeans.modules.form.FormEditor$3.run(FormEditor.java:337)
        at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
        at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
        at org.openide.util.Mutex.readAccess(Mutex.java:320)
        at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
        at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:334)
        at org.netbeans.modules.form.FormEditor.loadFormDesigner(FormEditor.java:232)
        at org.netbeans.modules.form.FormDesigner.finishComponentShowing(FormDesigner.java:1932)
        at org.netbeans.modules.form.FormDesigner.access$1100(FormDesigner.java:107)
        at org.netbeans.modules.form.FormDesigner$PreLoadTask$1.run(FormDesigner.java:1897)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
msg
Caused: java.lang.NullPointerException
        at org.statec.ide.ui.components.EnterprisePicker.addPropertyChangeListener(EnterprisePicker.java:654)
        at javax.swing.plaf.synth.SynthPanelUI.installListeners(SynthPanelUI.java:49)
        at javax.swing.plaf.synth.SynthPanelUI.installUI(SynthPanelUI.java:38)
        at javax.swing.JComponent.setUI(JComponent.java:662)
        at javax.swing.JPanel.setUI(JPanel.java:136)
        at javax.swing.JPanel.updateUI(JPanel.java:109)
        at javax.swing.JPanel.<init>(JPanel.java:69)
        at javax.swing.JPanel.<init>(JPanel.java:92)
        at javax.swing.JPanel.<init>(JPanel.java:100)
        at org.statec.ide.ui.components.EnterprisePicker.<init>(EnterprisePicker.java:39)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:168)
        at org.netbeans.modules.form.RADComponent.createBeanInstance(RADComponent.java:252)
        at org.netbeans.modules.form.RADComponent.initInstance(RADComponent.java:191)
        at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:851)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:1007)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:527)
        at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:299)
        at org.netbeans.modules.form.FormEditor$3.run(FormEditor.java:337)
        at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
        at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
        at org.openide.util.Mutex.readAccess(Mutex.java:320)
        at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
        at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:334)
[catch] at org.netbeans.modules.form.FormEditor.loadFormDesigner(FormEditor.java:232)
        at org.netbeans.modules.form.FormDesigner.finishComponentShowing(FormDesigner.java:1932)
        at org.netbeans.modules.form.FormDesigner.access$1100(FormDesigner.java:107)
        at org.netbeans.modules.form.FormDesigner$PreLoadTask$1.run(FormDesigner.java:1897)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Error in loading component: [JDialog]->enterprisePicker1
Cannot create instance of org.statec.ide.ui.components.EnterprisePicker.
The component cannot be loaded.

And for reference:

malbert@dredg:~/.netbeans/7.0/var/log$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

malbert@dredg:~/.netbeans/7.0/var/log$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:20:14+00:00Added an answer on May 25, 2026 at 8:20 pm

    Just a guess, but the problem could be that during initialization of some super class addPropertyChangeListener(...) is called (javax.swing.JPanel.<init> might be the culprit), thus this call happens before propertyChangeSupport is initialized.

    The initialization sequence of instance fields would be:

    • Object
    • Component
    • Container
    • JComponent
    • JPanel
    • EnterprisePicker

    If during initialization of JPanel the addPropertyChangeListener(...) method is called, it would actually be the overridden version of EnterprisePicker, but EnterprisePicker‘s fields would not have been initialized yet.

    To fix this you’d check for null in that method and initialize as needed (or call super.addPropertyChangeListener(...). Is there any need to have your own implementation (to add your own PropertyChangeSupport)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

recently got an issue when loading vs 2008, it displays this... can anyone tell
I recently got a shiny new development workstation. The only disadvantage of this is
Recently got this in my Event Log: A fatal hardware error has occurred. Reported
Alright well I recently got into normalizing my database for this little side project
I recently got a notification from a McAfee service (what used to be called
I recently got involved in a Java project at work: we're using MyEclipse for
We recently got some data back on a benchmarking test from a software vendor,
I recently got into Java. I have a background in dynamic languages and I'm
I recently got my home PC upgraded to a quad-core CPU and 64-bit OS.
I just recently got my first mac. I do lots of programming on windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.