9
有沒有一種方法,使從ProgressMonitor模態對話框?我可以使ProgressMonitor對話框模態嗎?
編輯:
的ProgressMonitor類JAVA API會帶來一個對話框,在頂部而不是模態。用戶仍然可以訪問後臺GUI。我正在尋找一個模態對話框來顯示進度,並允許用戶在中間停止任務。
有沒有一種方法,使從ProgressMonitor模態對話框?我可以使ProgressMonitor對話框模態嗎?
編輯:
的ProgressMonitor類JAVA API會帶來一個對話框,在頂部而不是模態。用戶仍然可以訪問後臺GUI。我正在尋找一個模態對話框來顯示進度,並允許用戶在中間停止任務。
如How to Use Progress Monitors所討論的,許多因素應考慮Deciding Whether to Use a Progress Bar or a Progress Monitor時。作爲一個實現細節,ProgressMonitor
是無模式,因爲「在Solaris implementation不支持Dialog.setModal
呢。」作爲一個實際問題,模態ProgressMonitor
只是一個JOptionPane
與JProgressBar
,但用戶可以欣賞努力避免這種模態行爲。
我的自定義ProgressThreadMonitor是模態,你可以更具體 – mKorbel
哪裏是你ProgressThreadMonitor? – 5YrsLaterDBA
我ProgressThreadMonitor基於http://download.oracle.com/javase/tutorial/uiswing/components/dialog.html和http://download.oracle.com/javase/tutorial/uiswing/components/progress.html,那麼你可以創建自己的JDialog#setModal(true);或者JDialog#setModalityType(Dialog.ModalityType.APPLICATION_MODAL);並在那裏放置你的JProgressBar,確保根據這些規則需要http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html – mKorbel