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


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


public class gui_oop3 extends JFrame {

  JButton BnTest1 = new JButton("Test1");
  JButton BnTest2 = new JButton("Test2");
  JButton BnTest3 = new JButton("Test3");
  JButton BnTest4 = new JButton("Test4");
  JButton BnTest5 = new JButton("Test5");

  MyJPanel leinwand = new MyJPanel();

  public gui_oop3() {
    setSize(500, 530);
    setLocation(200,100);
    setTitle("GUI mit OOP3");
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setGUI();
  }

  private void setGUI() {

    BnTest1.setFont( new Font("Arial", Font.BOLD,18)  );
    BnTest2.setFont( new Font("Arial", Font.BOLD,18)  );
    BnTest3.setFont( new Font("Arial", Font.BOLD,18)  );
    BnTest4.setFont( new Font("Arial", Font.BOLD,18)  );
    BnTest5.setFont( new Font("Arial", Font.BOLD,18)  );

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

	JPanel pnButton = new JPanel();
	//pnButton.setBackground(Color.red);
	pnButton.setLayout( new FlowLayout() );
	pnButton.add(BnTest1);
	pnButton.add(BnTest2);
	pnButton.add(BnTest3);
	pnButton.add(BnTest4);
	pnButton.add(BnTest5);

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

    BnTest1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
           BnTest1_Click();
        }
    });
    BnTest2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
           BnTest2_Click();
        }
    });
    BnTest3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
           BnTest3_Click();
        }
    });
    BnTest4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
           BnTest4_Click();
        }
    });
    BnTest5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
           BnTest5_Click();
        }
    });

    this.getContentPane().add( leinwand, BorderLayout.CENTER );

  } // setGUI


    private void BnTest1_Click() {
    }  // BnTest1_Click

    private void BnTest2_Click() {
    }  // BnTest2_Click

    private void BnTest3_Click() {
    }  // BnTest3_Click

    private void BnTest4_Click() {
    }  // BnTest4_Click

    private void BnTest5_Click() {
    }  // BnTest5_Click

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

}  // gui_oop3


class MyJPanel extends JPanel {
  public static int test=0;

  private void test0(Graphics g) {
    int x = 80;
    for (int i=0; i<60; i++) {
      g.drawLine(x,40,x,100);
      x += 1+ 10*Math.random();
    }
  }  // test0

  private void test1() {
  }  // test1

  private void test2() {
  }  // test2

  private void test3() {
  }  // test3

  private void test4() {
  }  // test4

  private void test5() {
  }  // test5

  public void paint (Graphics g)
  {
   switch (test) {
     case 0: test0(g);
             break;
     case 1: test1();
             break;
     case 2: test2();
             break;
     case 3: test3();
             break;
     case 4: test4();
             break;
     case 5: test5();
             break;
   }
  }  // paint

}