Questions
Q1 (a) Find out what fonts your computer has by calling the static getDefaultToolkit(
) on the Toolkit
class. (Remember it returns a String
array which you'll have to print to screen, say using a for loop set to
iterate for the stringArray.length)
When you build your simple class with a main method as it's first line
you'll also have to import java.awt.*
where Toolkit class resides.
(b) You'll notice the compiler tells you this
method is deprecated. Run the program with the -deprecation
option to see what the compiler says.
(c) Repeat the excercise using the code sample
from the notes containing the GraphicsEnvironment
references. What are the differences in the
fonts returned by the two techniques?
Q2 Look at the result of running the Colors program code example.
In reference to the three integer values returned
for each color;
(a) What do the colors red green blue have in common?
(b) What general formula can you use to describe the r g b numbers
that yield grey.
(c) If red green and blue are called primary colors, What might we
call secondary and tertiary colors
from the colors set returned by the program.
Q3 Create arrays of x and y coodinates for five points. Draw a polygon
using this array specifying
3, 4 and 5 points. What do you observe
for each?
Q5 Using Color, Font and Graphics create an art applets to appear on
a HTML page for
' The Maple General Store'