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