/******************************************************************************
* An Applet that displays a pie graph                          
******************************************************************************/

import javax.swing.JApplet;         //import swing JApplet class
import java.awt.*;                  //import all awt classes

public class PieApplet extends JApplet {        //this is a subclass of JApplet

    public void paint(Graphics g) {             //auto called by Applet

        g.drawString("A Pie Chart",50,25);      //draw a string at pixel 50/25

        g.setColor(Color.blue);                 //change the color
        g.fillRect(25,30,150,100);              //fill a rectangle with color   

        g.setColor(Color.red);                  //change the color
        g.fillOval(25,30,150,100);              //fill an oval with color

        g.setColor(Color.green);
        g.fillArc(25,30,150,100,0,60);
        g.fillArc(25,30,150,100,180,60);
    }
}