Modifying generated code for components


You can use a component's property sheet to affect the way the code is generated in the initComponents() method. In addition, you can write code and specify where it should be placed within initComponents().

To modify code generation for a component:

In the Custom Creation Code property, you can enter your own creation code for the component (not including the variable name and equal sign (=)). If this property is left blank, the IDE generates default creation code for the component.

You can change the variable name by modifying the Variable Name property.

You can also add code before and after a component's creation code and before and after its initialization code using the Pre Creation Code, Post Creation Code, Pre Init Code, and Post Init Code properties.

Note: The IDE always places creation code before initialization code in initComponents().

For information on adding pre- and post-initialization code for a component's property, see Using the Form Connection property editor.

Tip: You can also perform additional initializations of a form's components in the constructor after the call to initComponents (). For example, here you might initialize a button group or set component labels from resource bundles.


Contents Prev Next Index