Java Reference
In-Depth Information
Figure 3G.18
4 public static void main(String[] args) {
5 DrawingPanel panel = new DrawingPanel(200, 200);
6 Graphics g = panel.getGraphics();
7 for ( int i = 0; i < 20; i++) {
8 g.drawOval(i * 10, i * 10, 200 - (i * 10), 200 - (i * 10));
9
}
10 }
11 }
Exercises
1. Write a program that uses the DrawingPanel to draw Figure 3G.19.
Figure 3G.19
 
Search WWH ::




Custom Search