//-------------- Program GreetingApplet (Step 1) --------------------------//

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


/**
 * Introduction to OOP with Java 2nd Edition, McGraw-Hill
 *   
 *  Chapter 5
 *
 * <p>
 * An applet that accepts the user's name and
 * displays a personalized greeting.
 *
 * @author Dr. Caffeine
 *
 */
public class GreetingApplet extends Applet
{

//----------------------------------
//    Data Members
//----------------------------------

    /**
     * The Label to prompt the user for input
     */
    private Label      prompt;
    
    /**
     * The Lable to dislay the personalized greeting
     */
    private Label      greeting;
    
    /**
     * The TextField to accept the user input
     */
    private TextField  inputLine;

    
//----------------------------------
//    Constructors
//----------------------------------
                                
    /**
     * Default constructor that creates one TextField and
     * two Label objects.
     */
    public GreetingApplet( )
    {
        //Create GUI objects
        prompt    = new Label("Please enter your name:");
        greeting  = new Label( );
        inputLine = new TextField( 15 );
      
        //Now attach them to this applet, so they become
        //visible on the applet
        add( prompt    );
        add( inputLine );
        add( greeting  );  
    }

}