Long ago, in a galaxy far far away, most objects in NetBeans were created during startup. That works fine for a small application. It is disaster for a large application - with each new component in the system, startup time gets longer, garbage collections get more frequent and memory requirements rise.
Because of this, today, most of the APIs you will use to install things into the system involve a text entry (DevFaqWhenToUseWhatRegistrationMethod), such as putting something in an XML file (DevFaqModulesLayerFile), not running Java code. Ideally a module should do nothing on startup. Let's say that again, forcefully: Ideally a module should do nothing on startup.
The main ways to do this are using @ServiceProvider or using annotations which create XML layer entries that declare information about the things your module is installing. Then, when they are needed to do actual work, your objects will be instantiated.
If you really need to run some code on startup, see DevFaqWhenToUseWhatRegistrationMethod about ModuleInstall.
Applies to: NetBeans 6.7