Can I make ProgressMonitor dialog modal?
Asked Answered
S

1

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.

Sapajou answered 7/10, 2011 at 18:51 Comment(3)
my Custom ProgressThreadMonitor is Modal, can you be more concreteExpansion
where is your ProgressThreadMonitor?Sapajou
my ProgressThreadMonitor is based on download.oracle.com/javase/tutorial/uiswing/components/… and download.oracle.com/javase/tutorial/uiswing/components/…, 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 download.oracle.com/javase/tutorial/uiswing/concurrency/…Expansion
D
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.

Declinometer answered 8/10, 2011 at 2:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.