Getting Started


Arranging visual parts

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:

Align Left
Figure alinleft not displayed.

Align Center
Figure alincntr not displayed.

Align Right
Figure alinrit not displayed.

Align Top
Figure alintop not displayed.

Align Middle
Figure alinmidl not displayed.

Align Bottom
Figure alinbttm not displayed.

Distribute Horizontally
Figure dstrhorz not displayed.

Distribute Vertically
Figure dstrvert not displayed.

Match Width
Figure machwide not displayed.

Match Height
Figure machhite not displayed.

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,
  1. Place your mouse pointer over the part you want to select.
  2. While holding down the Ctrl key, move the mouse pointer to another part and click and release mouse button 1.

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:

  1. Select the Find button and then the Cancel button.

    The Find button has hollow handles and the Cancel button has solid handles.

  2. From the Tools menu, select Match Width.

    The Find button is resized to match the Cancel button in width.

  3. From the Tools menu, select Match Height.

    The Find button is resized to match the Cancel Push Button in height.

  4. From the Tools menu, select Align Middle.

    The Find button's vertical center is aligned to the center of the Cancel button.

  5. From the Tools menu, select Distribute Horizontally.

    The two buttons are placed at regular intervals across the Window.

Using the bounding box

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.

  1. Select the Phone label and the associated field.

    Both parts display selection handles.

  2. Move these parts to where you want them in the Window using mouse button 1.

    The Phone label and the associated field define the bottom of the bounding box, while Customer Number defines the top of the bounding box.

  3. Select all the fields (leave the labels unselected), making sure the Customer Number field is the last one selected.

    The Customer Number Text part should have primary selection handles (solid).

  4. Click mouse button 2 on one of the selected parts. Select Layout>Distribute>Vertically In Bounding Box.

    Now the fields are all evenly distributed in the top portion of the Window.

  5. From the Tools menu, select Align Left Figure alinleft not displayed.to align the parts on the left.

    All the fields are aligned on the left.

  6. Select all the labels, making sure that the Customer Number label is the last one selected.
  7. Click mouse button 2 on one of the selected parts. Select Layout>Distribute>Vertically In Bounding Box.

    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.

  8. From the Tools menu, select Align Left.

    All labels are aligned on the left.

In the next chapter, you will add the Address panel to this Window.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]