有没有办法让 ProgressMonitor 的对话框成为模态?
编辑:
JAVA API 中的 ProgressMonitor 类会带来一个对话框,它在顶部而不是 Modal。用户仍然可以访问后台 GUI。我正在寻找一个模态对话框来显示进度并允许用户在中间停止任务。
最佳答案
如 How to Use Progress Monitors 中所述, 在 Deciding Whether to Use a Progress Bar or a Progress Monitor 时应考虑许多因素.作为实现细节,ProgressMonitor
是无模式的,因为“Solaris implementation 还不支持 Dialog.setModal
。”实际上,模态 ProgressMonitor
只是一个带有 JProgressBar
的 JOptionPane
,但用户可能会喜欢避免这种模态行为的努力。
关于java - 我可以使 ProgressMonitor 对话框成为模态吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7691629/