アップレットの子ウィンドウ(JInternalFrame)・Javaの小技、サンプル、ニュースなどを紹介していきます。みんなで参考にしてください。

スポンサーサイト


上記の広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書く事で広告が消せます。

アップレットの子ウィンドウ(JInternalFrame)



画像のようなJInternalFrameを使った子ウィンドウは以下のように作ります。
JInternalFrame.isPaletteを指定することで、ウィンドウのバーが細くなります。


JInternalFrame frame = new JInternalFrame();
frame.setBounds(10, 10, 200, 200);
frame.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
frame.getContentPane().setLayout(new BorderLayout());
frame.setResizable(true);
frame.setBorder(BorderFactory.createEtchedBorder());
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.show();