FileDocCategorySizeDatePackage
HBoxWithStrut.javaAPI DocExample897Thu Oct 24 20:14:24 BST 2002None

HBoxWithStrut

public class HBoxWithStrut extends JFrame

Fields Summary
Constructors Summary
public HBoxWithStrut()

    super("Box & Strut Frame");
    setSize(370, 80);
    Box box = Box.createHorizontalBox();
    setContentPane(box);
    for (int i = 0; i < 3; i++) {
      Button b = new Button("B" + i);
      box.add(b);
    }

    // Add a spacer between the first three buttons and the last three
    box.add(Box.createHorizontalStrut(10));
    for (int i = 3; i < 6; i++) {
      Button b = new Button("B" + i);
      box.add(b);
    }
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    HBoxWithStrut bt = new HBoxWithStrut();