- 97 名前:デフォルトの名無しさん mailto:sage [2007/01/26(金) 16:44:51 ]
- >>89
二つのウインドウってインターナルフレームかい。 web上のサンプルの改造っぽいから、あまり>>89のソースを尊重せずに改造。 テンプレの書き方をよく見て、必須事項の漏れや誤記がないか確認してから投稿汁。 特にJavaのバージョンを書くこと。GUIの場合は制限なしは回答者にお任せを意味すると俺はみなす。 import javax.swing.*; public class TwoFrame extends JDesktopPane { public static void main(String[] args){ JFrame test = new JFrame("TwoFrame"); test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); test.add(new TwoFrame(), java.awt.BorderLayout.CENTER); test.setSize(400, 300); test.setVisible(true); } TwoFrame(){ for (String s : new String[]{"image1.jpg", "image2.jpg"}) { JInternalFrame frame = new JInternalFrame("画像 - " + s); frame.add(new JLabel(new ImageIcon(s))); frame.pack(); frame.setVisible(true); add(frame); } } }
|

|