Setting component properties in the Inspector

Overview of the Inspector

The Component Inspector allows you to visually edit component properties and to attach code to component events.

Inspector

With the Inspector, you can,

Any changes you make in the Component Inspector are reflected immediately in the source code and in the UI Designer.

Opening the Inspector

To display the Component Inspector,
  1. Select a java file in the Navigation pane.
  2. Click the Design tab at the bottom of the AppBrowser.
The Inspector is displayed at the right of the AppBrowser which now is in Design mode.

To adjust the width of its columns, click on the small sizing thumb at the top of the splitter bar, and drag right or left.

Choosing a display mode

You can choose one of two display modes for the Inspector:

To choose a display mode,

  1. Choose Tools|IDE options and click the AppBrowser tab.
  2. Select the desired option in the Inspector group box.


Setting property values

Properties are attributes that define how a component appears and responds at run time. In JBuilder, you set a component's initial properties during design time, and your code can change those properties at run time.

The Properties page in the Inspector displays the properties of the selected component(s). This is where you set the property values at design-time for any component in your design. By setting properties at design time, you are defining the initial state of a component when the UI is instantiated at run time.

Note: To modify the initial property values at run time, you can put code in the body of the methods or event handlers which you can create on the Events page of the Inspector.

To set a component's properties at design time,

  1. Select a component in a designer (UI Designer or Menu Designer) or in the Component Tree.
  2. Click the Properties tab of the Inspector to give it focus.
  3. Scroll until the property you want is visible, then select it with the mouse or the arrow keys.
  4. Enter the value in the right column one of the following ways:
  5. Press Enter following a text entry or drop-down list selection to commit a modification in the Inspector to code.

Tip: To quickly open a property editor or display a drop-down list, double-click the property value.

Setting shared properties for multiple components

When more than one component is selected, the Component Inspector displays only the properties they have in common that you can edit. When the value for the shared property differs among the selected components, the property value displayed is either the default or the value of the first component selected. When you change any of the shared properties in the Component Inspector, the property value changes to the new value in all the selected components.

To set properties for multiple components,

  1. Do one of the following to select the group of components to be changed:
  2. Select and edit the desired property in the Inspector.