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 ResizeButton extends Button {
  private int width, height;

  public ResizeButton(int width, int height) {
    super("Resize to " + width + "x" + height);
    this.width = width;
    this.height = height;
  }

  public boolean action(Event event, Object object) {
    getParent().resize(width, height);
    getParent().layout();
    return(true);
  }
}

