Java Reference
In-Depth Information
LISTING 2.11
continued
DISPLAY
snowman's head. The entire snowman figure is drawn relative to these values.
Using constants like these makes it easier to create the snowman and to make
modifications later. For example, to shift the snowman to the right or left in our
picture, only one constant declaration would have to change.
SELF-REVIEW QUESTIONS (see answers in Appendix N)
SR 2.45 What is a bounding rectangle?
SR 2.46 Assuming you have a Graphics object called page , write a statement
that will draw a square with a side length of 50, such that its upper-
left corner is at point (16, 12).
SR 2.47 Assuming you have a Graphics object called page , write a sequence of
statements that will draw a blue rectangle with a height of 20 and a
width of 40, such that its upper-left corner is at point (30, 35).
 
Search WWH ::




Custom Search