<HTML> <BODY> <P> <CENTER> <applet code="Pie.class" width=400 height=300> </applet> </CENTER> </P> </BODY> </HTML>
import java.awt.*; import java.applet.Applet; public class Pie extends Applet { public void paint (Graphics g) { g.setColor(Color.cyan); g.fillArc(100,50,200,200,0, 110); g.setColor (Color.red); g.fillArc (100,50,200,200,110,110); g.setColor (Color.green); g.fillArc (100,50,200,200,220,50); g.setColor (Color.blue); g.fillArc (100,50,200,200,270,45); g.setColor (Color.yellow); g.fillArc (100,50,200,200,315,45); g.setColor(Color.black); g.drawString("Republican", 115 , 135); g.drawString("Democrat", 205, 110); g.drawString("Independent", 230, 175); g.drawString("Green", 155, 210); g.drawString("Reform",210, 215); g.drawString("NOVEMBER 2000 ELECTION RESULTS", 100, 265); } }