
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;


// FlowLayout mit einem JPanel
public class FlowLayout2 extends JFrame {


  //Frame konstruieren
  public FlowLayout2() {
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setSize(500, 300);
    setTitle("FlowLayout2");
    setGUI();
  }

  private void setGUI() {
    JPanel panel;
    JButton bn;
    Integer I = new Integer(0);
    panel = new JPanel();
    panel.setLayout ( new FlowLayout() );


    panel.setBackground( new Color(200,200,00) );
    this.getContentPane().add(panel, BorderLayout.NORTH);




    for (int i=0; i<15; i++) {
      bn = new JButton( "Item: "+Integer.toString(i+1)  );
      panel.add(bn);
    //  bn.setPreferredSize( new Dimension(100,50) );
    }
     JTextArea editor = new JTextArea();
    this.getContentPane().add(editor, BorderLayout.CENTER);
  } // create




  public static void main(String[] args) {
    FlowLayout2 frame = new FlowLayout2();
    frame.setVisible(true);
  }


}
