Java SWT Refresh Multiple Shells From Button

爱⌒轻易说出口 提交于 2019-12-04 20:52:32

In the main form, you set up a Java Stack.

Stack<DataForm> stack = new Stack<DataForm>(); 

You pass a reference of this Stack to the data form(s).

In the constructor of the data form, you pass the data form instance.

stack.push(this);

In the destructor of the data form (on exit), you remove the data form instance.

int pos = stack.search(this);
stack.remove(pos);

When you want to refresh all of the forms, you loop through the stack.

for (DataForm dataForm : stack) {
     // do the refresh
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!