I am developing a Netbeans Platform application and face the following problem: When closing my app persists the opened windows A and B. Upon reopening my app the windows get deserialized one by one. First A then B. It is very possible that I receive new information for window B during the reopening of window A. At this point the program logic decides whether to open a new window B or use the existing one. But since window B doesn't exist yet it opens a new window. Afterwards the "old" window B is opened via deserialization.
我正在开发一个Netbeans平台应用程序,并面临以下问题:关闭我的应用程序时,持续打开的窗口A和B.重新打开我的应用程序后,Windows将逐个进行反序列化。首先是A然后B.在重新打开窗口A期间,我很可能收到窗口B的新信息。此时,程序逻辑决定是打开新窗口B还是使用现有窗口。但由于窗口B不存在,它会打开一个新窗口。然后通过反序列化打开“旧”窗口B.
Is there a way to wait until all windows are opened? I could delay the opening of additional windows until all windows are opened.
有没有办法等到所有窗户打开?我可以延迟打开其他窗口,直到所有窗口都打开。
I found nothing in the Windows-System API or in the class WindowManager.
我在Windows-System API或WindowManager类中找不到任何内容。
Any other idea?
还有其他想法吗?
1 个解决方案
#1
0
13 Views and 0 answers, we need more netbeans platform developers!
13意见和0个答案,我们需要更多netbeans平台开发人员!
WindowManager.getDefault().addWindowSystemListener(new WindowSystemListener() {
@Override
public void beforeLoad(WindowSystemEvent wse) {
}
@Override
public void afterLoad(WindowSystemEvent wse) {
// at this point all windows are opened
}
@Override
public void beforeSave(WindowSystemEvent wse) {
}
@Override
public void afterSave(WindowSystemEvent wse) {
}
});
#1
0
13 Views and 0 answers, we need more netbeans platform developers!
13意见和0个答案,我们需要更多netbeans平台开发人员!
WindowManager.getDefault().addWindowSystemListener(new WindowSystemListener() {
@Override
public void beforeLoad(WindowSystemEvent wse) {
}
@Override
public void afterLoad(WindowSystemEvent wse) {
// at this point all windows are opened
}
@Override
public void beforeSave(WindowSystemEvent wse) {
}
@Override
public void afterSave(WindowSystemEvent wse) {
}
});