Tuesday, November 4, 2008

DrawRoundRect

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

// This applet draws a rounded rectangle and then a
// filled, rounded rectangle.

public class DrawRoundRect extends Applet{

public void paint(Graphics g){

// Draw a rounded rectangle with an arcWidth of 20, and an arcHeight of 20
g.drawRoundRect(10, 10, 40, 50, 20, 20);

// Fill a rounded rectangle with an arcWidth of 10, and an arcHeight of 8
g.fillRoundRect(10, 80, 40, 50, 10, 6);

}

}