Yes. Use the Code Generation view of the component properties.

There actually are no restrictions on the instantiation of components - you'll find everything you need to do this on the Code Generation view of the component properties. You can completely replace the way components are instantiated, add code before or after creation and initialization. The only difference is that this code is stored in the XML .form file, so it is included when the guarded code is regenerated.

If you're writing a fairly simple bean, you may not want to use the GUI editor for that. But, if you have a burning desire to edit the contents of guarded blocks (again, do try the Code Generation view options - you have complete control over instantiation and initialization), copy your class and paste it into a generic class template. You won't be able to use the form editor to edit the results, but if you get your basic gui set up, that will work. Either approach will get you the results you want - use whichever you're more comfortable with.

Source: NetBeans User FAQ

Parent Category: Other API Tips