
//Titel:        Layout
//Version:
//Copyright:    Copyright (c) 1999
//Autor:       Ihr Name
//Organisation:      Ihre Organisation
//Beschreibung:  Ihre Beschreibung

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

import java.awt.event.*;

// Schalter mit einem Panel, 
// im Panel dann GridBagLayout

public class MKL_Aufgabe14 extends JFrame {


  public MKL_Aufgabe14() {
    setSize(700, 300);
    setTitle("14. Aufgabe der Musterklausur");
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setGUI();
  }

  private void setGUI() {
    this.getContentPane().setLayout( new GridBagLayout() );


    this.getContentPane().add( new JLabel("1. Text"),
        new GridBagConstraints(   0, 0, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("1. Eingabe"),
        new GridBagConstraints( 1, 0, 1, 1, 0.0, 0.0
            ,GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));


    this.getContentPane().add( new JLabel("2. Text"),
        new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("2. Eingabe"),
        new GridBagConstraints( 3, 0, 2, 1, 0.0, 0.0
            ,GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));



    this.getContentPane().add( new JLabel("3. Text"),
        new GridBagConstraints(   0, 1, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("3. Eingabe"),
        new GridBagConstraints( 1, 1, 1, 1, 100.0, 0.0
            ,GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));


    this.getContentPane().add( new JLabel("4. Text"),
        new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("4. Eingabe"),
        new GridBagConstraints( 3, 1, 2, 1, 100.0, 0.0
            ,GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));


// -----------------

    this.getContentPane().add( new JLabel("5. Text"),
        new GridBagConstraints(   0, 2, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("5. Eingabe"),
        new GridBagConstraints( 1, 2, 1, 1, 100.0, 0.0
            ,GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,20,30,20), 0, 0));


    this.getContentPane().add( new JLabel("6. Text"),
        new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0
            ,GridBagConstraints.NORTH,
            GridBagConstraints.NONE,
            new Insets(0,20,30,20), 0, 0));

    this.getContentPane().add( new JTextField("6. Eingabe"),
        new GridBagConstraints( 3, 2, 2, 1, 100.0, 0.0
            ,GridBagConstraints.EAST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,20,30,20), 0, 0));



    setFonts(getContentPane(), 18);   
  } // setGUI


 private void setFonts(Container cont, int size) {
    for (int i = 0; i < cont.getComponentCount(); i++) {
      Component c = cont.getComponent(i);
      if (c instanceof JPanel) {
        setFonts((JPanel) c, size);
      } else {
        c.setFont(new Font("Arial", Font.BOLD, size));
      }
    }
  }


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

}


