/** Assignment:  Modify this file (previously SimpleApplet2)
 ** by adding a few ornaments of your own design to the 
 ** Christmas tree. Also, edit MyApplet5.html in the      
 ** project directory, to run the MyApplet5.class file                                                                  
 ** you create, and to look nice.                        **/
 
/** USE EXISTING JAVA CLASSES **/

import java.awt.*;
import java.applet.Applet;

/** EXTEND THE JAVA APPLET CLASS **/

public class MyApplet5 extends Applet 
   {Font font = new Font("TimesRoman",Font.BOLD,30); // Define and initialize
    Color brown = new Color(128,128,0);	             // MyApplet5 class variables,						     				      
    Color purple = new Color(135,31,120);
    int xcoords[] = {151,167,162,178,173,189,184,200,195,211, // and arrays.
		     227,222,238,233,249,244,260,255,271};     
    int ycoords[] = {160,135,135,110,110,85,85,60,60,35,
		     60,60,85,85,110,110,135,135,160};
    int numpoints = xcoords.length;
    Polygon poly = new Polygon(xcoords,ycoords,numpoints);
    
    int xcoordss[] = {5,7,10,7,9};     
    int ycoordss[] = {0,3,3,5,10};
    int numpointss = xcoordss.length;
    Polygon poly2 = new Polygon(xcoordss,ycoordss,numpointss);
    
    public void init()	
       {setBackground(Color.white);}          // Change the gray background to white.
						      						     			         				     
    /** CREATE THE CURRENT FRAME **/

    public void paint(Graphics g)
       {g.setFont(font);
        g.setColor(Color.blue);
        g.drawString("A Little Computer Art?",55,25); // Paint text like SimpleApplet1.
	
	g.setColor(Color.red);
	g.fillRect(0,175,400,25);        // Paint red lamp platform.
	
	
	
	g.setColor(brown);                // This color was defined above.
	g.fillRect(206,160,10,15);        // Paint brown tree trunk.     
	
	g.setColor(Color.green);
	g.fillPolygon(poly);              // Paint, complete, and fill green tree.
        g.setColor(Color.blue);
        g.fillOval(169,100,10,10);
        
	g.setColor(Color.red);
	g.fillPolygon(poly2); 
	
        g.setColor(Color.yellow);
        g.drawArc(159,100,100,50,211,125);
	g.drawArc(159,101,100,50,211,125);
        g.drawArc(159,80,100,50,222,103);
	g.drawArc(159,81,100,50,222,103);
        g.drawArc(159,60,100,50,233,80);
	g.drawArc(159,61,100,50,233,80);
        g.drawArc(159,40,100,50,244,56);
	g.drawArc(159,41,100,50,244,56);
        g.drawArc(159,20,100,50,255,37);
	g.drawArc(159,21,100,50,255,37);
	
	g.setColor(Color.magenta);
        g.fillOval(189,80,15,18);
        
        g.setColor(Color.red);
        g.fillOval(203,34,16,15);
        g.setColor(Color.yellow);
	g.fillOval(204,34,7,7);
	
        g.setColor(Color.cyan);
        g.fillOval(254,155,10,10);
        
	g.setColor(purple);
        g.fillOval(204,130,15,15);
       
	 g.setColor(Color.black);
        g.fillOval(187,118,11,8);}    
    }