Java Swing GUI 沙漏 [英] Java Swing GUI hour glass
问题描述
在我的 Swing 程序中有一个 JTabbedPane
.当用户点击选项卡时,程序需要一段时间来获取数据并处理结果,然后在所选选项卡中显示结果.
There is a JTabbedPane
In my Swing program.
When user clicks on a tab, the program takes a while to get the data and process the results, then shows the results in the selected tab.
如何显示沙漏或类似效果,以便用户知道它正在处理数据?在完成工作之前不要再次单击该选项卡.
How can I display a hour glass, or something of that effect so that user knows it's processing data? Not to click on the tab again before it finishes it job.
推荐答案
A JProgressBar(可能处于不确定模式)听起来不错 - 将其放在选项卡上,直到获取数据.设计良好的 UI 不应强迫用户等待长时间运行的任务完成,而应允许他们在中间做其他事情.
A JProgressBar (possibly in indetermiante mode) sounds right - put that on the tab until the data has been fetched. A well-designed UI shouldn't force the user to wait for long-running tasks to complete and instead allow them to do something else inbetween.
这篇关于Java Swing GUI 沙漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!