Java Genesis
Hints for Chapter 2: Exploring Java
Problem 11: constructing a hollow square
Here is a suggested strategy. If the centre of the square is at position (196, 134) and
the square has width 100, then the position of the upper-left corner of the square will
be (196-50, 134-50). So what we need to do is
- move the square to (196-50, 134-50);
- set the width of the square to 100;
- set the color of the square to black;
- draw the square hollow.
Try this before looking at the next (and last) hint.
Next Hint