
//Titel:        Layout
//Version:
//Copyright:    Copyright (c) 1999
//Autor:       Ihr Name
//Organisation:      Ihre Organisation
//Beschreibung:  Ihre Beschreibung

// Einfaches JTabbedPane mit Farbpaletten	

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

import java.awt.event.*;

// Registerdarstellung in java

public class JTabbedPane01 extends JFrame {



  public JTabbedPane01() {
    setSize(400, 400);
    setTitle("JTabbedPane 1. Beispiel");
    setGUI();
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
  }

  private void setGUI() {
      // Definition des JTabbedPane
   JTabbedPane jTabbedPane1 = new JTabbedPane();
   jTabbedPane1.setFont( new Font("Arial", Font.BOLD,32));

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


      // 2.	Definition der Farbpanels
    myCanvas mc1 = new myCanvas(Color.green);
    myCanvas mc2 = new myCanvas(Color.red);
    myCanvas mc3 = new myCanvas(Color.blue);


    jTabbedPane1.add("grün",mc1);
    jTabbedPane1.add("rot",mc2);
    jTabbedPane1.add("blau",mc3);



     // Schalter definieren
    JButton BnOk = new JButton("Ok");
    BnOk.setFont( new Font("Arial", Font.BOLD,32));


    JPanel pnSouth = new JPanel();
    pnSouth.setLayout( new FlowLayout() );
    pnSouth.add(BnOk);
    this.getContentPane().add(pnSouth, BorderLayout.SOUTH );

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



  }  // setGUI




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



}


class myCanvas extends Canvas {

  public myCanvas(Color c) {
    setBackground(c);

  }
}


