February 2014
Beginner
1248 pages
62h 25m
English
Most of the graphics you’ve seen to this point did not vary with each program execution. Exercise 6.2 in Section 6.13 asked you to create a program that generated shapes and colors at random. In that exercise, the drawing changed every time the system called paintComponent. To create a more consistent drawing that remains the same each time it’s drawn, we must store information about the displayed shapes so that we can reproduce them each time the system calls paintComponent. To do this, we’ll create a set of shape classes that store information about each shape. We’ll make these classes “smart” by allowing objects of these classes to draw themselves by using a Graphics ...
Read now
Unlock full access