super("Horizontal Box Test Frame");
setSize(200, 100);
Panel box = new Panel();
// Use BoxLayout.Y_AXIS below if you want a vertical box
box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
setContentPane(box);
for (int i = 0; i < 3; i++) {
Button b = new Button("B" + i);
box.add(b);
}
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);