/*
    This class is a basic extension of the Applet class.  It would generally be
    used as the main class with a Java browser or the AppletViewer.  But an instance
    can be added to a subclass of Container.  To use this applet with a browser or
    the AppletViewer, create an html file with the following code:

    <HTML>
    <HEAD>
    <TITLE> A simple program </TITLE>
    </HEAD>
    <BODY>

    <APPLET CODE="camila97.class" WIDTH=332 HEIGHT=169></APPLET>

    </BODY>

    </HTML>

    You can add controls to camInit with Cafe Studio.
    (Menus can be added only to subclasses of Frame.)
 */

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

class ImagePanel extends Panel {
    Image image;

    public ImagePanel(Applet applet,String image) {
        this.image = applet.getImage(applet.getDocumentBase(),image);
    }
    public void paint(Graphics g) {
        Rectangle r = bounds();

        g.drawImage(this.image,0,0,r.width,r.height,this);
    }
}

public class camInit extends Applet {

    public void init() {

        super.init();

        //{{INIT_CONTROLS
        setLayout(new BorderLayout());
        pnlAbout = new ImagePanel(this,"camilo97.gif");
        pnlAbout.preferredSize();
        add("West",pnlAbout);
        lblAbout = new Label("CAMILA - The Prototyping Environment");
        lblAbout.setFont(new Font("Arial",Font.BOLD,24));
        add("East",lblAbout);
        lblCopyright = new Label("Copyright @ 1997 DI/INESC - Universidade do Minho, Braga, Portugal. All Rights Reserved.");
        lblCopyright.setFont(new Font("Dialog",Font.PLAIN,8));
        lblCopyright.resize(lblCopyright.preferredSize());
        add("South",lblCopyright);
        resize(preferredSize());
        //}}
    }

    public boolean handleEvent(Event event) {
        if (event.id == Event.GOT_FOCUS && event.target == pnlAbout) {
            clickedPnlAbout(event);
            return true;
        }
        else if (event.id == Event.ACTION_EVENT && event.target == lblAbout) {
            clickedLblAbout();
            return true;
        }

        return super.handleEvent(event);
    }

    //{{DECLARE_CONTROLS
    Label lblAbout;
    Label lblCopyright;
    ImagePanel pnlAbout;
    //}}

    public void clickedLblAbout() {
    }
    public void clickedPnlAbout(Event e) {
    }
}
