【问题标题】:Can I make ProgressMonitor dialog modal?我可以制作 ProgressMonitor 对话框模式吗?
【发布时间】:2011-12-03 05:55:16
【问题描述】:

有没有办法让 ProgressMonitor 的对话框成为模态?

编辑:

JAVA API 中的 ProgressMonitor 类会带来一个对话框,它在顶部,但不是 Modal。用户仍然可以访问后台 GUI。我正在寻找一个模态对话框来显示进度并允许用户在中间停止任务。

【问题讨论】:

标签: java swing jdialog jprogressbar concurrency


【解决方案1】:

正如How to Use Progress Monitors 中所讨论的,在Deciding Whether to Use a Progress Bar or a Progress Monitor 时应考虑许多因素。作为实现细节,ProgressMonitor 是无模式的,因为“Solaris implementation 还不支持Dialog.setModal”。实际上,模态 ProgressMonitor 只是带​​有 JProgressBarJOptionPane,但用户可能会欣赏避免这种模态行为的努力。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 2011-09-22
    • 1970-01-01
    相关资源
    最近更新 更多