Sizing, aligning, and positioning beans

This section describes the facilities available in the Visual Composition Editor for sizing, aligning, and positioning beans.

Note:
Beans that are containers (such as a JApplet or a  Frame) have a layout property. This property provides specific layout managers that control the positioning of beans within the container. Using a layout manager is the preferred way to create a user interface. However, if you use a <null> layout, the Visual Composition Editor provides tools for aligning and positioning beans.

Sizing beans

To size a bean, follow these steps:

  1. Select the bean you want to size. The selection handles display at each corner.
  2. Drag any one of the selection handles using mouse button 1 to adjust the size of the bean.
  3. Before you release the mouse button, an outline of the bean is displayed to show you the new size of the bean.

To size the bean in only one direction, hold down the Shift key while you drag a selection handle in a horizontal or vertical direction.

You can also use the constraints property in the bean's Properties window to size the beans. For more information about Properties windows, see Changing bean properties.

Aligning beans

To align beans with other beans in a <null> layout, follow these steps:

  1. Select the beans you want to align, ensuring that the last bean selected is the bean you want the others to align with.
  2. Select one of the following alignment tools from the tool bar:

    * Figure ALEFT not displayed. Align Left

    * Figure ATOP not displayed. Align Top

    * Figure ACENTER not displayed. Align Center

    * Figure AMIDDLE not displayed. Align Middle

    * Figure ARIGHT not displayed. Align Right

    * Figure ABOTTOM not displayed. Align Bottom

Matching the dimensions of another bean

You can size beans to the same width or height as another bean.

  1. Select the beans you want to match, ensuring that the last bean selected is the one you want the others to match.
  2. Select one of the following sizing tools from the tool bar:

    * Figure SIZEHZ not displayed. Match Width

    * Figure SIZEVT not displayed. Match Height

You can also match the dimensions of two or more beans by selecting them and then clicking mouse button 2. Select Layout and then Match Size from the pop-up menu that appears. You can select to match Width, Height, or Both.

Distributing beans evenly

To distribute beans evenly within a composite bean that uses <null> layout, follow these steps:

  1. Select the beans you want to distribute evenly.
  2. Select one of the following distribution tools from the tool bar:

    Distribute Horizontally

    * Figure SPACEVT not displayed. Distribute Vertically

To evenly distribute beans within an imaginary bounding box that surrounds the multiple-selected beans, follow these steps:

  1. Multiple-select the beans you want to evenly distribute. A minimum of three beans must be selected.
  2. From the pop-up menu of one of the selected beans, select Layout and then Distribute.  Then select one of the following:
     
    Horizontally In Bounding Box
    Evenly distribute the selected beans within the area bounded by the left-most edge of the left-most bean and the right-most edge of the right-most bean.
    Vertically In Bounding Box
    Evenly distribute the selected beans within the area bounded by the top-most edge of the top-most bean and bottom-most edge of the bottom-most bean.

    There are two more selections in Distribute:

    Horizontally In Surface
    Distributes the selected beans in the same way as Distribute Horizontally from the tool bar.
    Vertically In Surface
    Distributes the selected beans in the same way as Distribute Vertically from the tool bar.