/** 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,						     				      
    int xcoords[] = {232,248,243,259,254,270,265,281,276,292, // and arrays.
		     308,303,319,314,330,325,341,336,352};     
    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);
    
    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(Color.magenta);
	g.drawLine(100,175,100,125);      // Paint purple lamp left base.
	g.drawLine(150,175,150,125);      // Paint purple lamp right base.
	
	g.setColor(Color.magenta);
	g.drawArc(70,123,110,30,-63,306); // Paint purple lampshade bottom arc.
	g.drawArc(90,60,70,10,0,180);    // Paint purple lampshade top arc.
	
	g.setColor(Color.magenta);
	g.drawLine(70,137,92,63);        // Paint purple lampshade left side.
	g.drawLine(180,137,160,64);       // Paint purple lampshade right side.
	
	g.setColor(Color.purple);
	g.fillArc(65,92,27,27,-105,171);  // Paint lampshade left edge purple dot.
	g.fillOval(95,80,27,27);         // Paint lampshade left center purple dot.
	g.fillOval(130,80,27,27);         // Paint lampshade right center purple dot.
	g.fillArc(160,92,26,26,-75,-178); // Paint lampshade right edge purple dot.
	
	g.setColor(brown);                // This color was defined above.
	g.fillRect(287,160,10,15);        // Paint brown tree trunk.     
	
	g.setColor(Color.green);
	g.fillPolygon(poly);              // Paint, complete, and fill green tree.
      
	g.setColor (Color.pink);
	g.fillOval(287,80,8,8);
	g.fillOval(300,80,8,8);
	g.fillOval(272,80,8,8);
	
	g.setColor (Color.red);
	g.fillRect(288,120,10,10);
	g.fillRect(260,120,10,10);
	g.fillRect(310,120,10,10);
	
	g.setColor (Color.blue);
	g.fillOval(288,100,10,10);
	g.fillOval(272,100,10,10);
	g.fillOval(302,100,10,10);
	
	g.setColor(Color.white);
        g.drawArc(248,125,88,20,180,180);
        g.drawArc(259,103,66,17,180,180);
        g.drawArc(269,78,45,15,180,180);
        g.drawArc(280,53,23,13,180,180);
	
	
	
	
	}
	}