February 2014
Beginner
1248 pages
62h 25m
English
5.1 Draw 12 concentric circles in the center of a JPanel (Fig. 5.29). The innermost circle should have a radius of 10 pixels, and each successive circle should have a radius 10 pixels larger than the previous one. Begin by finding the center of the JPanel. To get the upper-left corner of a circle, move up one radius and to the left one radius from the center. The width and height of the bounding rectangle are both the same as the circle’s diameter (i.e., twice the radius).
Fig. 5.29 | Drawing concentric circles.
5.2 Modify Exercise 5.16 from the end-of-chapter exercises to read input using dialogs and to ...
Read now
Unlock full access