Prev Up
Go backward to A More Useful Applet
Go up to Top

Other Applet Possibilities

The preceding sections describe all that you are required to do for this lab. There are a number of ways you could change your "FirstApplet", however, to make it more interesting (and to get more experience working with Metrowerks).

First, you can include instructions in the body of "begin" which will be followed when the page containing the applet first appears on the screen. You can use this to display a message when the applet first appears (rather than starting with a blank screen).

Second, you can add a "color" parameter to your "drawString" commands. For now, the available colors are "Black", "White", "Blue", "Green", "Red", and "Yellow". So, the command:

pen.drawString("Click here","Yellow");
would display the text in yellow.

You can also paint the background one of these colors rather than erasing it by saying

pen.fillRect("Blue");
or using any of the other colors if you prefer.

Give some of these options a try and see how they work.



Prev Up