不是吧 JOptionPane 的文档可是这么说的:Each of these methods also comes in a showInternalXXX flavor, which uses an internal frame to hold the dialog box (see JInternalFrame). Multiple convenience methods have also been defined -- overloaded versions of the basic methods that use different parameter lists. All dialogs are modal. Each showXxxDialog method blocks the current thread until the user's interaction is complete.

解决方案 »

  1.   

    Tutorial 里的说明For most simple modal dialogs, you create and show the dialog using one of JOptionPane's showXxxDialog methods. If your dialog should be an internal frame, then add Internal after show — for example, showMessageDialog changes to showInternalMessageDialog. If you need to control the dialog's window-closing behavior or if the dialog isn't modal, then you should directly instantiate JOptionPane and add it to a JDialog instance. Then invoke setVisible(true) on the JDialog to make it appear.
      

  2.   

    All dialogs are modal. Each showXxxDialog method blocks the current thread until the user's interaction is complete.这一句说的是,所有的对话框都是模态的,也就是说你所说的
    变成模式的窗体
    其实默认情况下那些窗体已经是
    模式的了
    不用再指定了
      

  3.   

    我以前也遇到过,我想你是忘了把Internal Frame的this作为参数传给showMessageDialog了,这个参数是一定要传的,不然的话,当你点击Internal Frame时刚show出来的确Dialog就会失去焦点。试试吧。