Tuesday, November 4, 2008

DrawRect3D

import java.awt.*;
import java.applet.*;

public class DrawRect3D extends Applet{

public void paint(Graphics g){

// Make the drawing color the same as the background
g.setColor(getBackground());

// Draw a raised 3-D rectangle in the upper-left
g.draw3DRect(10, 10, 60, 40, true);

// Draw a lowered 3-D rectangle in the upper-right
g.draw3DRect(100, 10, 60, 40, false);

// Fill a raised 3-D rectangle in the lower-left
g.fill3DRect(10, 80, 60, 40, true);

// Fill a lowered 3-D rectangle in the lower-right
g.fill3DRect(100, 80, 60, 40, false);

}
}