你是指Frame里嵌Frame么?为什么不嵌Panel呢?

解决方案 »

  1.   

    我就是指Frame里嵌套Frame,或者Frame和Dialog互相嵌套。偶不是在写程序,是在准备考试,所以问问
      

  2.   

    还有,为什么这个程序报错说add a window to a containerimport java.awt.*;public class TFDL extends Frame
    {
      public static void main(String[] args)
      {
        TFDL tfdl=new TFDL();
      }
      
      public TFDL()
      {
        FileDialog fidi=new FileDialog(this,"Choose",FileDialog.LOAD);
        //fidi.setVisible(true);
        add(fidi);
        setVisible(true);
        System.out.println(fidi.getFile());
        System.out.println(fidi.getDirectory());
      }
    }
      

  3.   

    it's false, for Frame are top level window,cann't be nested!
      

  4.   

    -----------------------------------
    那么 Dialog也是顶级类喽