它的整体结构与应用情况是怎么回事???????

解决方案 »

  1.   

    JDesktopPane是桌面窗格,来实现桌面上的内部窗体(JInternalFrame)的特定界面样式行为。
    给你个demo:
    public class Test extends JApplet {
    JButton b = new JButton("make frame"); JDesktopPane desk = new JDesktopPane();
    // JPanel desk=new JPanel(); int count = 0; public Test() {
    Container contentPane = getContentPane();
    contentPane.add(b, BorderLayout.NORTH);
    contentPane.add(desk, BorderLayout.CENTER);
    desk.setLayout(new FlowLayout());
    // desk.setDesktopManager(new OutlineManager());
    b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    count = count + 1;
     JInternalFrame jf = new JInternalFrame(
     "Internal Frame"+count,//title
     true,//resizable
     true,//closable
     true,//maximizable
     true);//iconifiable
    // JButton jf = new JButton("" + count);
    jf.setPreferredSize(new Dimension(50, 20));
    desk.add(jf);
    desk.revalidate();
    System.out.println(count);
    } });
    }
    }
      

  2.   

    用于创建多文档界面或虚拟桌面的容器。用户可创建 JInternalFrame 对象并将其添加到 JDesktopPane。JDesktopPane 扩展了 JLayeredPane,以管理可能的重叠内部窗体。它还维护了对 DesktopManager 实例的引用,这是由 UI 类为当前的外观 (L&F) 所设置的。注意,JDesktopPane 不支持边界。 此类通常用作 JInternalFrames 的父类,为 JInternalFrames 提供一个可插入的 DesktopManager 对象。特定于 L&F 的实现 installUI 负责正确设置 desktopManager 变量。JInternalFrame 的父类是 JDesktopPane 时,它应该将其大部分行为(关闭、调整大小等)委托给 desktopManager。
      

  3.   

    它是用来管理所有JInteralFrame的,平时只有一两个倒用不着它,当JInternalFrame多的时候,用起来就相当方便.