Modifying Code Generation for a Component

  1. Select the component whose initialization code you want to modify in the Component Inspector.

    If the selected component is a form (instead of a component on a form), see Modifying Code Generation for a Form.

  2. Click the Code Generation tab at the bottom of the Component Inspector to view the Code Generation properties. Set any or all of the properties as follows:

    Code Generation. Choose between generating standard or serialization code for the component.

    Custom Creation Code. Enter your own creation code for the component, not including the variable name and equal sign (=). This creation code is called in the initComponents() method. If this property is left blank, the IDE generates a default creation code for the component.

    Post-Creation Code, Post-Init Code, Pre-Creation Code, and Pre-Init Code. Write custom code that you want the IDE to place before and after a component's creation code and before and after its initialization code. The IDE always places creation code before initialization code in initComponents().

    Serialize To. Set the name of the file for the component to be serialized to, if it is serialized.

    Use Default Modifiers. Set to True if you want the component's variable modifiers (public, private, and so on) to be generated using the default modifiers. The default modifiers are specified in the Variables Modifier property of the Form Objects node in the Options window. (Choose Tools Options to view the window.)

    Set to False if you want the Variables Modifier property to appear on the component's property sheet, enabling you to override the default modifiers.

    Variable Name. Modify the component's variable name.

See also
Modifying Code Generation for a Form

Modifying Code Generation for a Property


Legal Notices