// CSE 142, Autumn 2010 // Author: Marty Stepp // This program draws several boxes at different positions. // It is a demonstration of graphics with for loops. import java.awt.*; public class Loops { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(150, 140); Graphics g = panel.getGraphics(); for (int i = 0; i < 5; i++) { // x y w h g.drawRect(11 + 20 * i, 98 - 20*i, 20, 20); } } }