You should get something like this:
House --- ( 65, 100) width=110, height=110 Door --- (120, 165) width= 25, height= 40 Left Window --- ( 90, 115) width= 30, height= 30 Right Window --- (130, 115) width= 30, height= 30 Tree Trunk --- (255, 100) width= 10, height=100
With this information,
you can start coding the applet.
The code starts by defining
variables that contain the above coordinates.
Give the variables names that show their use.
For example houseX
is the X coordinate
of the left edge of the house.
houseW
is the width of the house.
You may think that it would be just as easy to put the numbers directly
into the drawRect()
method.
But if you need to make adjustments later on,
it is very useful to have
names for the various values you wish to change.
Fill in the blanks.