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

// Beispiel mit einem zusaetzlichen JPanel und GridLayout
// ein Schalter in SOUTH, komplette Breite

public class GridLayout3 extends JFrame {


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

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

     this.getContentPane().setLayout( new BorderLayout() );

    panel = new JPanel();
    panel.setLayout ( new GridLayout(5,3) );
    for (int i=0; i<15; i++) {
      bn = new JButton( Integer.toString(i+1)  );
      bn.setFont( new Font("Arial", Font.BOLD,18)  );
      panel.add(bn);
    }
    this.getContentPane().add(panel, BorderLayout.CENTER);
    JButton bn16 = new JButton( "16" );
    bn16.setFont( 
       new Font("Arial", Font.BOLD,18)  );
    this.getContentPane().add(bn16,
       BorderLayout.SOUTH);


  } // create





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


}
