Hi friend,
In following java code I have used RootPaneContainer interface, review it carefully:
Code:
import javax.swing.RootPaneContainer;
public class RootPaneContainerSD extends JFrame
{
public RootPaneContainerSD()
{
super("Custom MDI: Part V");
setSize(550,400);
getContentPane().setBackground(new Color(254,222,142));
setLayeredPane(new MDIPane());
ImageIcon ii1 = new ImageIcon("earth.jpg");
InnerFrame[] frames1 = new InnerFrame[5];
for(int i1=0; i<5; i++)
{
frames1[i1] = new InnerFrame("InnerFrame " + i);
frames1[i1].setBounds(60+i1*20, 50+i*20, 300, 200);
frames1[i1].getContentPane().add(
new JScrollPane(new JLabel(ii1)));
getLayeredPane().add(frames[i1]);
}
WindowListener l1 = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
} }
setVisible(true);
}
public static void main(String[] arngs)
{
new RootPaneContainerSD();
}
}
Bookmarks