Help: Color list


Help is available for each task, or you can go straight to the solution source code.

Task 1

Create a new applet called ColorList. Add a Button and ColorEditor bean to the applet. Now drop it into your applet.
To add the ColorEditor bean select the Options->Add Bean... menu-item, and then click Browse in the dialog that appears; enter ColorEditor in the Pattern field and click OK.

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


Connect the button's actionPerformedEvent to the applet's setBackground(java.awt.Color) method, which is accessed via Connect->All features... when establishing the connection.

The connection is still incomplete: you need to establish a connection between the ColorEditor's value property and the previous connection's value property.

Repeat the same steps to set the background color of the ColorEditor bean.


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