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

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

public class ImageButtons extends Applet {
  public void init() {
    addButtons("images/Marty-Plate-Small.gif", 75, 39);
    addButtons("images/Java-Logo.gif", 55, 50);
  }

  private void addButtons(String file,
                          int width, int height) {
    Panel panel = new Panel();
    ImageButton button;
    for(int i=0; i<3; i++) {
      button = new ImageButton(getCodeBase(), file);
      button.setBorder(button.getBorder() + 4*i);
      panel.add(button);
    }
    add(panel);
    panel = new Panel();
    for(int i=0; i<3; i++) {
      button = new ImageButton(getCodeBase(), file);
      button.setBorder(button.getBorder() + 4*i);
      button.resize(width*(i+1), height*(i+1));
      panel.add(button);
    }
    add(panel);
  }
}

