import javax.swing.*; public class DesktopContainer{ JFrame frame; JPanel panel; JInternalFrame iframe; JButton button1, button2; JDesktopPane desk; public static void main(String[] args) { DesktopContainer d = new DesktopContainer(); } public DesktopContainer(){ frame = new JFrame("Creating a JDesktopPane Container"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); iframe = new JInternalFrame("Internal frame", true,true,true,true); iframe.setToolTipText("This is internal frame"); panel = new JPanel(); button1 = new JButton("Ok"); button1.setToolTipText("This is Ok button of internal frame"); panel.add(button1); button2 = new JButton("Cancel"); button2.setToolTipText("This is cancel button of internal frame"); panel.add(button2); iframe.add(panel); iframe.setSize(250,300); iframe.setVisible(true); desk = new JDesktopPane(); desk.add(iframe); frame.add(desk); frame.setSize(400,400); frame.setVisible(true); } }