如何将JOptionPane与其JFrame相关联?

时间:2017-06-30 08:50:49

标签: java swing

嘿,我正在开展一个项目,我必须集中我的对话框的框架.i.e。当我恢复我的框架时,我想让对话框到达它的中心(框架的中心)给出一个特定的通用代码如何做到这就是我尝试过的但是它没有工作

如果(U→1)

{
final JFrame frame = new JFrame("multiple pagetable changes!!!");
frame.setLocationByPlatform(true);

final JOptionPane pane1= new JOptionPane(change_log);
final JDialog d1 = pane1.createDialog(frame,"");
d1.pack();
d1.setLocationRelativeTo(null);
d1.setVisible(true);
}

0 个答案:

没有答案