To arrange visual parts you can use the tool bar buttons or selections from the Tools menu. Each tool bar button has a corresponding menu choice with the same name that performs the same function. The menu choices or buttons you use to arrange visual parts are as follows:
In this tutorial, you'll be directed to the menu choices, but feel free to use the tool bar buttons instead.
Note: | Like the choices on the Tools menu, many of the buttons on the
tool bar are unavailable unless you have more than one visual part
selected. To select two or more parts at the same time,
Repeat step 2 as many times as necessary, until you have selected all the parts you need to size or align in relation to each other. Notice that the part you select last has solid handles, while the other selected parts have hollow handles. The part with solid handles is used as a reference point. So, when you want to align several parts, select the parts you want to move first. Those parts will be aligned with the part you select last. |
In "Defining a reusable visual part", you will add an Address panel to the Customer Information window. So arrange the labels and fields at the top of the Window and the push buttons at the bottom, leaving enough room for the Address panel between them.
For a complete description of the tool bar and the tools available, refer to Composition Editor in the VisualAge help facility or the VisualAge for Java User's Guide.
To arrange the visual parts on the Customer Information window, perform the following steps:
The Find button has hollow handles and the Cancel button has solid handles.
The Find button is resized to match the Cancel button in width.
The Find button is resized to match the Cancel Push Button in height.
The Find button's vertical center is aligned to the center of the Cancel button.
The two buttons are placed at regular intervals across the Window.
Next, align the labels and fields in the top portion of the Window, leaving space in the middle for the Address panel.
The bounding box enables you to align selected parts within a portion of your Window, rather than the entire Window. The selected portion is defined by the topmost and bottommost, or leftmost and rightmost sides of the parts selected.
Both parts display selection handles.
The Phone label and the associated field define the bottom of the bounding box, while Customer Number defines the top of the bounding box.
The Customer Number Text part should have primary selection handles (solid).
Now the fields are all evenly distributed in the top portion of the Window.
All the fields are aligned on the left.
Now the labels are all evenly distributed in the top portion of the Window. If you are not satisfied with your results, from the Edit menu, select Undo and try again.
All labels are aligned on the left.
In the next chapter, you will add the Address panel to this Window.