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


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


public class TestrbScolling extends JFrame {

  JButton bnOk = new JButton("Ok");
  JButton bnEsc = new JButton("Abbruch");


  private JPanel jpanel;


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

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


    this.getContentPane().setLayout( new BorderLayout() );
    jpanel = new JPanel();
	add( new JScrollPane( jpanel ),BorderLayout.CENTER);
    jpanel.setLayout( new GridBagLayout());
    jpanel.setBackground(Color.red);
    JRadioButton rb;
    for (int i=0; i<10; i++) {
      rb = new JRadioButton( (i+1)+". Schalter");
      jpanel.add(rb,
         new GridBagConstraints(
             0, i, 1, 1, 100.0, 0.0
            ,GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0,0,0,0), 0, 0));
   }

  } // setGUI



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

}  // TestrbScolling


