Color list


In this Magercise, you will create an applet that can change it's background color by having the user select a color via a ColorEditor bean.

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.colorlist.

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 ColorList. Add a Button and ColorEditor bean to the applet. Now drop it into your applet.

  2. Now establish a connection between the button, the ColorEditor and the applet such that clicking the button sets the applet's background color to that displayed in the ColorEditor.

    Also make a similar connection such that the ColorEditor's background color gets set as well.

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.