A Triangle drawn with fillPolygon



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

public class fillpolydemo extends Applet
{
	public void paint(Graphics g)
	{
      /*To draw a triangle, we first
        create two int arrays, one for
        the x coordinates, and one for
        the y coordinates */
		int []nXpts = {30,50,60};
		int []nYpts = {70,50,90};
		g.setColor(Color.red);
      
      //the last argument is the number of corners
		g.fillPolygon(nXpts,nYpts,3);
	}
}