简体   繁体   中英

ModalDialog blocking in java

I have a long task which is running and I am popping up a modaldialog with MainUI.modalDialog.setVisible(true); which has a ProgressBar. However I do observe that it is blocking the process. How do I popup the Dialog without blocking whatever is running in my frame?

That is the modal dialogs behavior. The options are that you either don't display it as modal or you display it in a separate thread.

You should whatever is running in your frame into another Thread, in case it is not GUI code. Also you could run the modal dialog in a separate GUI thread.

http://en.wikipedia.org/wiki/Modal_window

"In user interface design, a modal window is a child window that requires users to interact with it before they can return to operating the parent application, thus preventing the workflow on the application main window. Modal windows are often called heavy windows or modal dialogs because the window is often used to display a dialog box."

Solution: Do not use a Modal Window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM