import javax.swing.*;

public class FlowLayoutDemo {
  public static void main(String[] args) {
    JFrame frame = new JFrame("FlowLayout Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel panel = new JPanel(); // Defaults to FlowLayout
    panel.add(new JButton("One"));
    panel.add(new JButton("Two"));
    panel.add(new JButton("Three"));
    panel.add(new JButton("Four"));
    panel.add(new JButton("Five"));    

    frame.setContentPane(panel);
    frame.pack();
    frame.setVisible(true);
  }
}