MDI- Multi Document Interface
The JDesktopPane class, can be used to create "multi-document" applications. A multi- document application can have many windows included in it. The JDesktopPane is a container which is used to create a multiple-document interface or a virtual desktop.The JFrame inside the desktop becomes JInternalFrame. JInternalFrame is used just like the JFrame but is added to JDesktopPane object.
JDesktopPane jd=new JDesktopPane();
JInternalFrame frame1=new JInternalFrame("Internal Frame1",true,true,true,true);
frame1.setLayout(null); frame1.setSize(200,100);
frame1.setVisible(true);
JInternalFrame frame2=new JInternalFrame("Internal Frame2",true,true,true,true);
frame2.setLayout(null);
frame2.setSize(200,100);
frame2.setVisible(true);
JInternalFrame frame3=new JInternalFrame("Internal Frame3",true,true,true,true);
frame3.setLayout(null); frame3.setSize(200,100);
frame3.setVisible(true); jd.add(frame1);
jd.add(frame2);
jd.add(frame3);