Plan for a Picture

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

Yes, I always do.

Plan for a Picture

Artists make sketches and preliminary drawings before starting on a big project. When planning to use Java to draw a picture, it is useful to have a sketch on graph paper, like the following:

house and a tree

Artists use the sketch to help them transfer their ideas to canvas. We will use the sketch to trasfer our ideas into a program. The location of objects in terms of X Y coordinates can be read off the graph paper.

QUESTION 2:

Say that you decide to make a picture that is 350 pixels wide by 250 pixels high. (Mentally) label the grid lines of the graph paper in the above. Put X=0, Y=0 at the top left corner.