
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);
   BnOk.addMouseListener(new java.awt.event.MouseAdapter() {
     
         public void mouseEntered(MouseEvent e) {
           BnOk.setText("Abbruch");
           BnEsc.setText("Ok");
           // BnOk.setVisible(false);
         }
   
         public void mouseExited(MouseEvent e) {
           BnEsc.setText("Abbruch");
           BnOk.setText("Ok");
         }
     });

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


  } // setGUI



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

}  // bsp1


