![]() |
![]() |
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.
To size a bean, follow these steps:
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.
To align beans with other beans in a <null> layout, follow these steps:
Align
Left
Align Top
Align Center
Align Middle
Align Right
Align Bottom
You can size beans to the same width or height as another bean.
Match
Width
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.
To distribute beans evenly within a composite bean that uses <null> layout, follow these steps:
Distribute Horizontally
Distribute Vertically
To evenly distribute beans within an imaginary bounding box that surrounds the multiple-selected beans, follow these steps:
There are two more selections in Distribute:
![]() |
![]() |