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

public class flag extends Applet 
{
AudioClip s;
Polygon p;
int x;
int y;

	public void init()
	{
		try{
		   s = getAudioClip(getDocumentBase(),"nationalanthem.au");
		}
		catch ( Exception e)
		{
		   System.out.println("Ooops! Problem with URL.");
		}
	}


	public boolean mouseDown(Event e, int x, int y)
	{
		if(s != null) s.play();
		return true;	
	}


	public void paint (Graphics g)
	{
		g.setColor (Color.white);    //background white
		g.fillRect( 0,0, 170, 130);
		
		g.setColor (Color.blue);     // corner blue
		g.fillRect( 0,0, 70, 70);

		g.setColor (Color.red);      // stripes
		g.fillRect(70,0,  100,10);
		g.fillRect(70,20, 100,10);
		g.fillRect(70,40, 100,10);
		g.fillRect(70,60, 100,10);
		g.fillRect(0, 80, 170,10);
		g.fillRect(0, 100,170,10);
		g.fillRect(0, 120,170,10);

		g.setColor (Color.white);    // stars
		
		p = new Polygon();
		p.addPoint(8,3);
		p.addPoint(3,8);
		p.addPoint(9,5);
		p.addPoint(3,5);
		p.addPoint(3,3);
		p.addPoint(8,8);	
		

		for(x=0;x<7;x=x+1){
			for(y=0;y<7;y=y+1){
			   g.fillPolygon(p);
			   g.translate(0,9);
			}		
		 g.translate(9,-63); //next column
		}
	}
}
