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


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


public class bsp1 extends JFrame {

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


  private JPanel jpanel;


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

  private void setGUI() {
    setSize(400, 430);
    setTitle("JFrame als Dialog");

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

    this.getContentPane().setLayout( new BorderLayout() );
    jpanel = new JPanel();
    jpanel.setBackground(Color.red);
    this.getContentPane().add( new JScrollPane(jpanel), BorderLayout.CENTER);

	JPanel pnButton = new JPanel();
	//pnButton.setBackground(Color.red);
	pnButton.setLayout( new FlowLayout() );
	pnButton.add(BnOk);
	pnButton.add(BnEsc);

    this.getContentPane().add( pnButton, BorderLayout.SOUTH );

          BnOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
              BnOk_Click();
            }
          });


          BnEsc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
              BnEsc_Click();
            }
          });


  } // setGUI

    private void BnOk_Click() {
        System.out.println("Hier in Ok");
    }

    private void BnEsc_Click() {
        setVisible(false);
        System.exit(0);
    }







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

}  // bsp1


