//Titel:            Dialog-Fenster
//Version:
//Copyright:		Copyright (c) 2010
//Autor:
//Organisation:
//Beschreibung:


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


public class Layout1 extends JFrame {


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

  private void setGUI() {
    setSize(500, 250);
    setTitle("JFrame als Dialog");


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

  JLabel jLabel1 = new JLabel("Eingaberrrrrrrrrrr");

       this.getContentPane().add(jLabel1,
         new GridBagConstraints(
             0, 0, 1, 1, 100.0, 0.0
            ,GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(10,10,10,10), 0, 0));

   jLabel1.setFont( new Font("Arial", Font.BOLD,24));
 
 JTextField tf = new JTextField("..");

       this.getContentPane().add(tf,
         new GridBagConstraints(
             1, 0, 1, 1, 00.0, 0.0
            ,GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(10,0,10,10), 0, 0));

   tf.setFont( new Font("Arial", Font.BOLD,24));   

JLabel jLabel2 = new JLabel("EingabeEingabe");

       this.getContentPane().add( new JButton("jLabel2"),
         new GridBagConstraints(
             0, 1, 1, 1, 00.0, 0.0
            ,GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,10,10,10), 0, 0));

   jLabel2.setFont( new Font("Arial", Font.BOLD,24));

JTextField tf2 = new JTextField("..");

       this.getContentPane().add(tf2,
         new GridBagConstraints(
             1, 1, 1, 1, 100.0, 0.0
            ,GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,0,10,10), 0, 0));

   tf2.setFont( new Font("Arial", Font.BOLD,24));   

 
   JPanel panel = new JPanel();
   panel.setBackground(Color.RED);
   panel.setLayout( new FlowLayout() );
   

JButton bn1 = new JButton("Ok");

JButton bn2 = new JButton("Abbrechen");

panel.add(bn1);
panel.add(bn2);

       this.getContentPane().add(panel,
         new GridBagConstraints(
             0, 2, 2, 1, 0.0, 0.0
            ,GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,0,0,0), 0, 0));

   bn1.setFont( new Font("Arial", Font.BOLD,24));
 
   bn2.setFont( new Font("Arial", Font.BOLD,24));
 
bn1.setPreferredSize( bn2.getPreferredSize());

  } // setGUI


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

}  // Layout1


