我可以使用JOptionPane.showConfirmDialog来调度JInternalFrame吗?

Dax*_*ati 2 java swing frame jinternalframe

我可以JOptionPane.showConfirmDialog用来展示JInternalFrame吗?

我试过以下代码:

OPD.Registration opdRegister = new OPD.Registration(); 
//OPD.Registration is extending JInternalFrame    

int ns=JOptionPane.showConfirmDialog(null, opdRegister, "Billing", JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE);
// i am trying to call opdregister in this Confirm Dialog Box.
Run Code Online (Sandbox Code Playgroud)

通过使用上面的代码显示对话框JInternalFrame但不显示正确.它只显示标题栏.其他数据是从JInternalFrame.

如何增加此对话框的大小?

tra*_*god 6

是的,虽然a JInternalFrame打算用于JDesktopPane.如果你只看到标题栏,确认您的内容具有最佳尺寸pack()内部框架,如图所示这里.