Directly editing components in the Design view

Some text properties can be directly edited on the Design view of the visual editor.

About this task

When you work in the visual editor for Java™, you can change the properties of many components just by manipulating them in the Design view. For example, you can edit the text strings for most components that include labels. The new values are reflected in the Source view and in the Properties view. Adding text strings can also affect visual layout, which is reflected in the Design view. For example, a long text string for a button can affect the alignment and size of the button.

Tip: You can also directly edit items by selecting Set [property] from the pop-up menu, in both the Java Beans view and the Design view. For example, you can right-click a JLabel and select Set Text.

To directly edit the text for a component in the Design view:

Procedure

  1. Select the component in the Design view.
  2. Click the component again. A direct edit text field displays in the upper left corner of the component.
  3. Type the text that you want to use for the component, and press Enter.
    Directly editing the text label for a component in the Design view

Results

The text that you typed is reflected in the Design view, in the source (the set method), and in the Properties view for that particular property.

Feedback