//Program 10.4: A Poetry applet that processes an unknown number of parameters
import java.applet.Applet;    
import java.awt.Graphics; 
             
public class PoetryApplet extends Applet {

  String[] poem;
  int numlines = 101;

  public void init() {

    int i;
    String nextline;
    poem = new String[numlines];

    for (i = 1; i < numlines; i++) {
      nextline = getParameter("Line" + i);
      if (nextline == null) break;
      poem[i] = nextline;
    }
    numlines = i-1;
    
  }
  
  public void paint(Graphics g) {
  
    int y = 15;
  
    for (int i=1; i <= numlines; i++) {
      g.drawString(poem[i], 5, y);    
      y += 15;
    }
    
  }
  
} 
