sky*_*ork 1 java user-interface swing multithreading awt
我有一个从主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
...
...
Run Code Online (Sandbox Code Playgroud)
任何建议都会受到欢迎.谢谢.
我有一个从主GUI线程调用的对象,并显示一个单独的JFrame
如果你想展示多个TopLayoutContainer或许最好寻找JDialog,因为你可以使用ModalityType和toFront().
是不是show()弃用了方法并用方法JDialog.setVisible(boolean)替换?
| 归档时间: |
|
| 查看次数: |
774 次 |
| 最近记录: |