1 /* 2 * File: RectTest2.java 3 * 4 * Draw a rectangle and a filled rectangle. 5 * Draw another rectangle inside the first rectangle. 6 * 7 * Copyright: Northeast Parallel Architectures Center 8 * 9 */ 10 11 import java.applet.Applet; 12 import java.awt.Graphics; 13 14 public class RectTest2 extends Applet { 15 16 public void paint( Graphics g ) { 17 18 // draw a rectangle at point ( 20, 15 ): 19 g.drawRect( 20, 15, 100, 100 ); 20 21 // draw another rectangle inside the previous rectangle: 22 g.drawRect( 40, 35, 60, 60 ); 23 24 // draw a filled rectangle at point ( 140, 15 ): 25 g.fillRect( 140, 15, 100, 100 ); 26 27 } 28 29 }