
import java.awt.*;
import javax.swing.*;

/**
 * Class AboutMe - My self-introduction page 
 * 
 * @author Chase Coner
 * @version JDK 8
 * @date 9/11/15
 * @course CSCI 1130-01
 */
public class AboutMe extends JApplet
{
    // instance variables - replace the example below with your own
    private int x;

    /**
     * Called by the browser or applet viewer to inform this JApplet that it
     * has been loaded into the system. It is always called before the first 
     * time that the start method is called.
     */
    public void init()
    {
        // this is a workaround for a security conflict with some browsers
        // including some versions of Netscape & Internet Explorer which do 
        // not allow access to the AWT system event queue which JApplets do 
        // on startup to check access. May not be necessary with your browser. 
        JRootPane rootPane = this.getRootPane();    
        rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
    
        // provide any initialisation necessary for your JApplet
    }

    /**
     * Called by the browser or applet viewer to inform this JApplet that it 
     * should start its execution. It is called after the init method and 
     * each time the JApplet is revisited in a Web page. 
     */
    public void start()
    {
        // provide any code requred to run each time 
        // web page is visited
    }

    /** 
     * Called by the browser or applet viewer to inform this JApplet that
     * it should stop its execution. It is called when the Web page that
     * contains this JApplet has been replaced by another page, and also
     * just before the JApplet is to be destroyed. 
     */
    public void stop()
    {
        // provide any code that needs to be run when page
        // is replaced by another page or before JApplet is destroyed 
    }

    /**
     * Paint method for applet.
     * 
     * @param  g   the Graphics object for this applet
     */
    
    public void paint(Graphics g)
    {
        super.paint(g); 
        // simple text displayed on applet
        //g.setColor(Color.white);
        //g.fillRect(0, 0, 200, 100);
        //g.setColor(Color.black);
        //g.drawString("Sample Applet", 20, 20);
        //g.setColor(Color.blue);
        //g.drawString("created by BlueJ", 20, 40);
        
         //Insert Image
        
        Image img = getImage(getDocumentBase(),"NightBackground2.jpg");
        
        
        //Add "NightBackground2.jpg" as the background
        
        g.drawImage( img, 0,0,getWidth(), getHeight(), this );
        
        
        //Draws the moon using an oval
        
        g.drawOval(575, 0, 500, 400);
        
        
        //Fills the moon yellow
        
        g.setColor(Color.yellow);
        
        g.fillOval(575, 0, 500, 400);
        
    
        //Insert image
        
        Image myPhoto = getImage(getDocumentBase(),"PhotoOne.jpg");
        
        
        //Scale image
        
        g.drawImage( myPhoto, 650, 70, 350, 250, this );
        
  
        //Changes font, font size, and color of title
        
        g.setFont(new Font("forte", Font.BOLD, 24) );
        
        g.setColor(Color.white);
        
        g.drawString("Welcome to my About Me Page", 20, 20);
        
        
        //Changes font, font size, and color of description
        
        g.setColor(Color.yellow);
        
        g.setFont(new Font("Times New Roman", Font.BOLD, 18) );
        
        g.drawString("Full Name: Chase Conner", 20, 60);    
        
        g.drawString("Preferred Name: Chase", 20, 80);
        
        g.drawString("Favorite Food: Fried Calamari", 20, 100);
        
        g.drawString("Fun Facts: I got my driver's permit on an April 1st--", 20, 120);
        
        g.drawString("people would question its authenticity after seeing the date", 105, 140);
        
        g.drawString("I was a cashier at Cub Foods for my first job", 105, 160); 
        
        g.drawString("Background image from viaviralnova.xyz-", 700, 480);
        

        
        
        
        
         
        

        
        
        








        

    
     
 
        
        
      
        
    }

    /**
     * Called by the browser or applet viewer to inform this JApplet that it
     * is being reclaimed and that it should destroy any resources that it
     * has allocated. The stop method will always be called before destroy. 
     */
    public void destroy()
    {
        // provide code to be run when JApplet is about to be destroyed.
    }


    /**
     * Returns information about this applet. 
     * An applet should override this method to return a String containing 
     * information about the author, version, and copyright of the JApplet.
     *
     * @return a String representation of information about this JApplet
     */
    public String getAppletInfo()
    {
        // provide information about the applet
        return "Title: AboutMe  \nAuthor: Chase Conner \nA self-introduction page ";
    }


    /**
     * Returns parameter information about this JApplet. 
     * Returns information about the parameters than are understood by this JApplet.
     * An applet should override this method to return an array of Strings 
     * describing these parameters. 
     * Each element of the array should be a set of three Strings containing 
     * the name, the type, and a description.
     *
     * @return a String[] representation of parameter information about this JApplet
     */
    public String[][] getParameterInfo()
    {
        // provide parameter information about the applet
        String paramInfo[][] = {
                 {"firstParameter",    "1-10",    "description of first parameter"},
                 {"status", "boolean", "description of second parameter"},
                 {"images",   "url",     "description of third parameter"}
        };
        return paramInfo;
    }
}
