Modifying GUI Source Code

See Also

The IDE automatically generates blue guarded blocks of code as you create your GUI form in the GUI Builder. However, you can modify the way initialization code is generated and even write custom code to be placed within the initialization code.

Modifying Code Generation for Form Components

You can modify the way initialization code is generated for a component, form, or component property by editing its Code properties in the Properties window. In addition, you can write custom code and specify where it should be placed within the initialization code.

To modify a form component's guarded block:

  1. In the Inspector window, select the component whose initialization code you want to edit.
  2. Click the Code button at the top of the Properties window to view the Code properties.
  3. Select the property you wish to edit and enter the desired value.

    The IDE updates the selected component's guarded code block with the new value.

Modifying Code Generation for a Property

The IDE enables form component properties to be initialized in more ways than simply setting static values.

The IDE enables you to initialize property values from:

To modify the initialization code generated for a component's property:

  1. Select the component in the Inspector window.
  2. Click the Properties button at the top of the Properties window.
  3. Select the property for which you would like to modify the initialization code.
  4. Click the ellipsis (...) button to bring up the Property Editor dialog box.
  5. Select Form Connection from the Select Mode combo box.
  6. In the Property Editor, select the type of initialization code you would like to add (Value, Bean, Property, Method Call, or User Code). The IDE adds the new code to the selected component's guarded block.

Modifying GUI Form Code Outside of the IDE

In the IDE each form is comprised of two files:

You can edit the .java files using external editors (not while the form is being edited in the IDE), with the following exceptions:

See Also
Editing Component Properties
Configuring the GUI Builder
About Java GUIs

Legal Notices