且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

以编程方式关闭当前显示的 Java Swing JDialog 框

更新时间:2023-12-03 15:12:22

尽管关闭对话框就像在其上调用 setVisible(false) 一样简单,但我认为您的方法不是用户直观的.显示两个对话框是一种糟糕的 UI 做法.您需要做的是显示进度动画/对话框.搜索返回后,停止进度动画/对话框并显示返回的数据.以下是有关该主题的一些链接:

Even though closing dialog is as simple as calling setVisible(false) on it, I think your approach is not user intuitive. Showing two dialogs is a bad UI practice. What you have to do is to show progress animation/dialog. Once your search returns stop the progress animation/dialog and show the data returned. Here are some links about the subject:

http://java.sun.com/docs/books/tutorial/uiswing/components/progress.htmlhttp://developerlife.com/tutorials/?p=248