/** Copyright (c) 1997 Sams.net Publishing. All Rights Reserved.
 ** Teach Yourself Java 1.1, Laura Lemay and Charles L. Perkins.
 ** Adapted From Listing 8.1:  The HelloAgainApplet applet.
 **
 ** Modified to SimpleApplet1 by John Pais, December 1997.   **/
 
Toggle your browser's Back and Forward buttons to compare the running applet to this code.
Click here to run a fresh copy of the applet:  SimpleApplet1.html

/** USE EXISTING JAVA CLASSES **/

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

/** EXTEND THE JAVA APPLET CLASS **/

public class SimpleApplet1 extends Applet
   {Font font = new Font("TimesRoman",Font.BOLD,30);  // Define and initialize a
                                                                                         // SimpleApplet1 class variable.
     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("An applet a day,",140,110);
         g.drawString("keeps Dr. Pais at bay.",140,150);
        }
    }