1  /*
  2   *  File:  MoreHelloApplet.java
  3   *
  4   *  Yet another Hello World applet
  5   *
  6   *  Copyright:  Northeast Parallel Architectures Center
  7   *  
  8   */
  9  
 10  import java.applet.Applet;
 11  import java.awt.Font;
 12  import java.awt.Graphics;
 13  import java.awt.Color;
 14  
 15  public class MoreHelloApplet extends Applet {
 16  
 17    Font f = new Font( "TimesRoman", Font.BOLD, 36 );
 18    public String name;
 19    
 20    public void init() {
 21      // Get the "Name" parameter from the HTML document:
 22      name = getParameter( "Name" );
 23      if ( name == null ) name = "World";
 24    }
 25    		   
 26    public void paint( Graphics g ) {
 27      g.setFont( f );
 28      g.setColor( Color.red );
 29      // Concatenate strings with + operator:
 30      String str = "Hello " + name + "!";
 31      g.drawString( str, 5, 50 );
 32    }
 33    
 34  }