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 DrawFillPolygon extends java.applet.Applet
{
	int xCoords[] = { 50, 200, 300, 150, 50, 50 };
	int yCoords[] = { 100, 0, 50, 300, 200, 100 };
	int xFillCoords[] = { 450, 600, 700, 550, 450, 450 };
	public void paint(Graphics g)
	{
		g.drawPolygon(xCoords, yCoords, 6);
		g.fillPolygon(xFillCoords, yCoords, 6);
	}
}
/*	<applet code=DrawFillPolygon width=300 height=300>
 	</applet>
*/
Output