go to previous page   go to home page   go to next page

Answer:

No. PC Paint, or a similar drawing tool would be better. It is much easier to create a picture with a painting program than by progamming.


Static Pictures

Usually you would not use Java to draw a static picture. Java is used when the picture changes in response to user interaction, or is dynamically created based on ever-changing data.

For example, an interactive game might be written in Java. Perhaps the house and landscape are the background and the characters of the game move across the screen.

Sometimes a picture contains many elements that can be computed by a program, but are too numerous for a human to specify individually.

It would be illuminating to compile and run the program and play with it for a while. Change the size of the frame. What happens to the house picture?

As written, the program draws the picture in a 350x250 rectangle no matter what the size of the frame. The parts of the picture that don't fit are cut off. The parts of the frame beyond the dimensions of the picture are not used.


poor display of the house picture

QUESTION 9:

It would be nice to scale the picture to match the size and shape of the frame.

If the frame is doubled in width (from 350 to 700), how should every X dimension in the drawing be scaled?

If the frame is reduced in height by 3/5 (from 250 to 150), how should every Y dimension in the drawing be scaled?