2014-12-07 23 views
0

我搜查了网络,找不到能帮助我的具体事情。我有我的Swing Worker类在后台做一些工作,而这种情况正在发生,我想禁用我的用户界面上的所有内容。摆荡者工作时禁用所有东西?

我不想从一个按钮到下一个(Jlist,Jtable)等,并禁用一切。有更容易的方法吗;像在我的UI上绘制一些东西,然后在Swing Worker完成时将其删除?有人可以告诉我如何做这样的事情。或者你会有什么建议。

我已经知道如何在Swing Worker完成时获得通知。只是寻找停止一切的最佳方式。

+1

怎么样[这](http://stackoverflow.com/questions/19324918/how-to-disable-all-components-in-a-jpanel/19328368#19328368)或[this](http://stackoverflow.com/questions/12169662/how-would-i-disable-a-text-box/12169692#12169692)或[this](http:// stackoverflow .com/questions/20799814/how-to-disable-enable-jframe-component-when-jinternalframe-isvisible-inside-jfra/20813257)或[this](http://stackoverflow.com/questions/19799451/的java阻挡焦点从 - 的JComponent/19801009#19801009) – MadProgrammer 2014-12-07 23:21:02

回答

0

最好的办法是以递归的方式解析你的JFrame.getChildren()。

但你也可以使用一个GlassPane-看到Root Panes

相关问题