Rubrik 1 SMD038


 
This page is displaying a simple example of an HTML page and an applet.
Here is the code of this applet.

ALT="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is ignoring the <APPLET> tag!

Select, "View Source" (or similar), if you want to see how this HTML-page is written.

Here are my directories for the book ... (a simplified way).


/**
 * HelloApplet prints the name of the course.
 * 
 * @author Jan-Åke Lehto
 * @version ver.1 August 30th, 2001
 */
         import java.awt.*;
         import java.applet.*;

public class HelloApplet extends Applet
{
    public void paint (Graphics g)
    {
        setBackground(Color.yellow);
        g.setColor(Color.blue);
        g.setFont(new Font("Serif",Font.BOLD,24));     
        g.drawString("Welcome to SMD038, Imperative Programming!", 20, 70);
    } // paint
} // end HelloApplet

Så här ser HTML-koden ut för att kalla på Appleten:
<applet code="HelloApplet.class" width=600 height=100>
ALT="Your browser understands the <APPLET> tag but isn't running the 
    applet, for some reason." Your browser is ignoring the <APPLET> tag! 
</applet>