May i can use JOptionPane.showConfirmDialog for dispay JInternalFrame?

天大地大妈咪最大 提交于 2019-12-09 21:58:00

问题


May i can use JOptionPane.showConfirmDialog for display JInternalFrame?

I tried following code:

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.

By using above code that display dialog box with JInternalFrame but it not display proper. It display only title bar. Other data are cut from the JInternalFrame.

How can I increase size of this dialog?


回答1:


Yes, although a JInternalFrame is intended for use in a JDesktopPane. If you're seeing only the title bar, verify that your content has a preferred size and pack() the internal frame, as shown here.



来源:https://stackoverflow.com/questions/19905221/may-i-can-use-joptionpane-showconfirmdialog-for-dispay-jinternalframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!