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


public class gl1 extends JFrame {

  JButton BnOk = new JButton("Ok");
  JButton BnEsc = new JButton("Abbruch");

  public gl1() {
    setDefaultCloseOperation( 
         JFrame.EXIT_ON_CLOSE );
    setGUI();
  }

  private void setGUI() {
    setSize(400, 430);
    setTitle("GridbagLayout");

    BnOk.setFont( new Font("Arial", Font.BOLD,18)  );
    BnEsc.setFont( new Font("Arial", Font.BOLD,18)  );

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

    JLabel label1 = new JLabel("dies ist das erste Label");
    Font f = new Font("Arial", Font.BOLD,18); 
    label1.setFont( f );
    add(label1,
       new GridBagConstraints(
            0, 0, 1, 1, 0.0, 0.0
      ,GridBagConstraints.WEST,
      GridBagConstraints.NONE,
         new Insets(20,20,20,20), 0, 0));

     JTextField editor = new JTextField("Name");
     editor.setFont( f );
     add(editor,
       new GridBagConstraints(
            1, 0, 1, 1, 90.0, 0.0
      ,GridBagConstraints.WEST,
      GridBagConstraints.HORIZONTAL,
         new Insets(20,0,20,20), 0, 0));

       add(BnOk,
       new GridBagConstraints(
            0, 1, 1, 1, 0.0, 0.0
      ,GridBagConstraints.WEST,
      GridBagConstraints.NONE,
         new Insets(0,0,0,0), 0, 0));

      add(BnEsc,
       new GridBagConstraints(
            1, 1, 1, 1, 0.0, 0.0
      ,GridBagConstraints.EAST,
      GridBagConstraints.NONE,
         new Insets(0,0,0,0), 0, 0));

  } // setGUI

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

}  // gl1


