Java Applet Program to draw and fill Polygon

Write a Java Applet Program to draw and fill Polygon.



Source Code
import java.awt.Graphics;

public class DrawPolygons extends java.applet.Applet
{
	int xCoords[] = { 50, 200, 300, 150, 50 };
	int yCoords[] = { 100, 0, 50, 300, 200 };
	int xFillCoords[] = { 450, 600, 700, 550, 450 };
	public void paint(Graphics g)
	{
		g.drawPolygon(xCoords, yCoords, 5);
		g.fillPolygon(xFillCoords, yCoords, 5);
	}
}
/*	<applet code=DrawPolygons width=300 height=300>
 	</applet>
*/
Output