楼上的意思是另外开一个window吗,那具体用window要怎样去掉close按钮呢。如果不用window呢,用
showModalDialog就不行吗?可否详细一点。

解决方案 »

  1.   

    Window和JWindow都不会显示关闭按钮。
    注意:最好给window设置owner。java.awt.Window
    A Window object is a top-level window with no borders and no menubar. The default layout for a window is BorderLayout. 
    javax.swing.JWindow
    A JWindow is a container that can be displayed anywhere on the user's desktop. It does not have the title bar, window-management buttons, or other trimmings associated with a JFrame, but it is still a "first-class citizen" of the user's desktop, and can exist anywhere on it. From the older java.awt.Window object you would normally do something like this: 
    window.add(child);
    However, using JWindow you would code: 
           window.getContentPane().add(child);
      

  2.   

    可是我说的是javascript里的showModalDialog对象。不是swing的冬冬啊。我是在网页里用的。
      

  3.   

    干吗用showModalDialog呢,用层做一个也行啊