我可以将 ProgressMonitor 对话框设置为模态吗?
有没有办法使对话框从 ProgressMonitor 模式化?
编辑:
JAVA API 中的 ProgressMonitor 类将带来一个位于顶部但不是模态的对话框。用户仍然可以访问后台 GUI。我正在寻找一个模态对话框来显示进度并允许用户在中间停止任务。
is there a way to make the dialog from ProgressMonitor modal?
EDIT:
The ProgressMonitor class in JAVA API will bring a dialog which is on the top but not Modal. User still has access to the background GUI. I am looking for a Modal dialog to show the progress and also allow user to stop the task in the middle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如如何使用进度监视器中所述,决定是使用进度条还是进度监视器。作为实现细节,
ProgressMonitor
是无模式的,因为“Solaris 实现尚不支持Dialog.setModal
。”实际上,模态ProgressMonitor
只是一个带有JProgressBar
的JOptionPane
,但用户可能会喜欢避免这种模态行为的努力。As discussed in How to Use Progress Monitors, a number of factors should be considered when Deciding Whether to Use a Progress Bar or a Progress Monitor. As an implementation detail,
ProgressMonitor
is modeless because "the Solaris implementation doesn't supportDialog.setModal
yet." As a practical matter, a modalProgressMonitor
is just aJOptionPane
with aJProgressBar
, but users may appreciate an effort to avoid such modal behavior.