JDesktopPaneTest.java



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

 /** コンストラクタ */
    public JDesktopPaneTest() {
        super();
        GridPanel gridPanel = new GridPanel();
        BorderPanel borderPanel = new BorderPanel();
        GridBagPanel gridBagPanel = new GridBagPanel();
        JInternalFrame gridFrame
            = new JInternalFrame( "GridLayout" );
        JInternalFrame borderFrame
            = new JInternalFrame( "BorderLayout" );
        JInternalFrame gridBagFrame
            = new JInternalFrame( "GridBagLayout" );
        gridFrame.getContentPane().add( gridPanel );
        borderFrame.getContentPane().add( borderPanel );
        gridBagFrame.getContentPane().add( gridBagPanel );
        gridFrame.setSize( 300, 200 );
        borderFrame.setSize( 300, 200 );
        gridBagFrame.setSize( 300, 200 );
        gridFrame.setVisible( true );
        borderFrame.setVisible( true );
        gridBagFrame.setVisible( true );
        gridFrame.setIconifiable( true );
        borderFrame.setIconifiable( true );
        gridBagFrame.setIconifiable( true );
        gridFrame.setResizable( true );
        borderFrame.setResizable( true );
        gridBagFrame.setResizable( true );
        add( gridFrame );
        add( borderFrame );
        add( gridBagFrame );
    }

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

        JFrame frame = new JFrame( "JDesktopPane Test" );
        JDesktopPaneTest pane = new JDesktopPaneTest();
        frame.getContentPane().add( pane );
        frame.setSize( 800, 600 );
        frame.setVisible( true );
    }
}