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.

/** Illustrates that Java 1.1 lightweight containers
 *  can be transparent.
 * @see HeavyPanel
 */

class LightweightPanel extends Container {
  public LightweightPanel() {
     setLayout(new FlowLayout());
  }
}

public class LightPanel extends Applet {
  public void init() {
    setFont(new Font("TimesRoman", Font.BOLD, 18));
    LightweightPanel light = new LightweightPanel();
    light.add(new Button("Button 1"));
    light.add(new Button("Button 2"));
    add(light);
  }

  public void paint(Graphics g) {
    int width = getSize().width,
        height = getSize().height;
    for(int y=5; y<height; y=y+5)
      g.drawLine(0, y, width, y);
    super.paint(g); // Don't forget this
  }
}
