9

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.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
5YrsLaterDBA
  • 33,370
  • 43
  • 136
  • 210
  • my Custom ProgressThreadMonitor is Modal, can you be more concrete – mKorbel Oct 07 '11 at 18:56
  • where is your ProgressThreadMonitor? – 5YrsLaterDBA Oct 07 '11 at 19:04
  • my ProgressThreadMonitor is based on http://download.oracle.com/javase/tutorial/uiswing/components/dialog.html and http://download.oracle.com/javase/tutorial/uiswing/components/progress.html, then you can create by own JDialog#setModal(true); or JDialog#setModalityType(Dialog.ModalityType.APPLICATION_MODAL); and put there your JProgressBar, be sure that required based on these rules http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html – mKorbel Oct 07 '11 at 19:20

1 Answers1

4

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 support Dialog.setModal yet." As a practical matter, a modal ProgressMonitor is just a JOptionPane with a JProgressBar, but users may appreciate an effort to avoid such modal behavior.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045