本帖最后由 String_net 于 2009-09-20 21:36:11 编辑

解决方案 »

  1.   

    JDialog(Dialog owner, String title, boolean modal) 
              创建一个具有指定标题、模式和指定所有者 Dialog 的对话框。
    modal = true
      

  2.   

    用自定义关闭事件实现
    //给主窗口添加监听
    this.addWindowListener(new winAdapter(this));
    //监听类
    class winAdapter extends WindowAdapter {
    public void windowClosing(WindowEvent windowEvent) {
    关闭代码,可以在这里恢复主窗口
    }
    }
      

  3.   

    主窗口无法恢复焦点
    是因为你Main.setEnable(false)