May i can use JOptionPane.showConfirmDialog for di

2019-04-12 21:51发布

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条回答
虎瘦雄心在
2楼-- · 2019-04-12 22:10

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.

查看更多
登录 后发表回答