本帖最后由 java2000_net 于 2008-08-05 16:40:50 编辑

解决方案 »

  1.   

    <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
       <title>onbeforeunload测试</title>
       <script>
       function checkLeave(){
             event.returnValue="确定离开当前页面吗?";
       }
       </script>
       </head>
       <body onbeforeunload="checkLeave()">
       </body>
       </html>
      

  2.   

    可以试下JOptionPane类
    int i=JOptionPane.showConfirmDialog(null,"你是否关闭??","关闭信息",JOptionPane.YES_NO_OPTION);
    if(i==JOptionPane.YES_OPTION)
    {
                    }else
                    {                }