JTabbedPaneTest.java



/** JTabbedPane のテスト */
import java.awt.*;
import javax.swing.*;
public class JTabbedPaneTest extends JTabbedPane {

 /** コンストラクタ */
    public JTabbedPaneTest() {
        FlowPanel flowPanel = new FlowPanel();
        GridPanel gridPanel = new GridPanel();
        BorderPanel borderPanel = new BorderPanel();
        CardPanel cardPanel = new CardPanel();
        GridBagPanel gridBagPanel = new GridBagPanel();
        addTab( "FlowLayout", flowPanel );
        addTab( "GridLayout", gridPanel );
        addTab( "BorderLayout", borderPanel );
        addTab( "CardLayout", cardPanel );
        addTab( "GridBagLayout", gridBagPanel );
    }

 /** 最初に呼び出されるメソッド */
    public static void main( String argv[] ) {

        JFrame frame = new JFrame( "JTabbedPane Test" );
        JTabbedPaneTest pane = new JTabbedPaneTest();
        frame.getContentPane().add( pane );
        frame.setSize( 400, 300 );
        frame.setVisible( true );
    }
}