Compass points


In this exercise, you will create an applet that has buttons at all points of the compass and the center position of a BorderLayout.

An OS/2 C version of this Magercise exists in this directory. Note that the behavior of the C program may not be the same as the Magercise -- it is presented here for comparision against the Java application you will write in this Magercise. One of the major differences is that the C version does not support layout managers, so resizing a window will not resize the contents of that window.

Work Location

Perform all work for this magercise in VisualAge project MageLang Magercises, package magercises.compasspoints.

If this project does not appear in your Workspace add it from the repository (if it exists there) or create a new project using this name.

Tasks

Perform the following tasks:

  1. Create a new applet called CompassPoints. Change it's layout from none (null) to BorderLayout.

  2. Create and add a new button for each position: North, South, East, West, and Center.

  3. Save your applet and test it by pressing the "Test Bean" button, which is the first button on the toolbar in the Visual Composition Editor.

The task numbers above are linked to the step-by-step help page. Also available is a complete solution to the problem, and expected behavior, to demonstrate it.

Copyright © 1996-1997 MageLang Institute. All Rights Reserved.