问题描述
||
我有一个从主GUI线程调用的对象,该对象显示一个单独的JFrame数秒,然后消失(使用计时器)。现在,我要使主GUI线程等待,直到弹出的JFrame窗口消失为止。例如,在主GUI代码上:
// initiate the object and show the pop-up JFrame
disappearingJFrame djf = new disappearingJFrame ();
djf.show ();
// Now the main GUI thread should wait
// and after the pop-up JFrame disappears,the rest of the code is then executed
...
...
任何建议都将受到欢迎。谢谢。
解决方法
为此,请不要使用单独的JFrame。使用JOptionPane或模式JDialog。
, 我有一个从主GUI线程调用的对象,并显示了一个单独的JFrame
如果要显示多个TopLayoutContainer,则最好查找JDialog,因为这样您就可以使用ModalityType和toFront()。
方法
show()
是否已被弃用并由方法JDialog.setVisible(boolean)取代?