Exercise 4: Adding Multiple Components

In this exercise, you will add buttons to the remaining empty cells in the grid.
  1. Enlarge the layout window to approximately seven inches wide and seven inches high.
    You will be adding a button (approximately 1 inch long) in each cell.

  2. Click the Text Button component in the Visual Java palette.

  3. Hold down the Control key and click in all empty cells except the rightmost cell in the last row.
    Pressing the Control key allows you to continue adding the selected component to the grid.

  4. Select the button in the third column of the last row and drag it into the cell on the right.
    The button now spans two cells.

  5. Click the Save control on the Visual Java tool bar.

    Your GUI should look like this:

Next lesson:

Exercise 5: Finishing the Layout