wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes multiple modal dialogs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "multiple modal dialogs" Watch "multiple modal dialogs" New topic
Author

multiple modal dialogs

Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
Hi,
Is it possible to have more than 1 modal dialog for different JFrames. I have to pop up a modal dialog on click of a button ( which is on a JFrame), that part is easy but tricky part is, there could be cases where I have multiple instance of JFrames visible on screen but since a Modal Dialog is already poped up it blocks the input to other JFrames.
Is there a possible solution out of this ? I used to think that a modal dialog is modal to its parent Frame , but it seems to be modal to all other Frames.
Regards,
Vijay
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Vijay,
As you may have guessed, Modal is to your application (all Frames). The only way out is to use non-modal dialogs and have each frame keep track of their own private dialog.
Regards,
Manfred.
Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
Manfred,
Thanks for replying to my query.
Could you point out how to make a JDaolog behave as a modal dialog with out setting it modal explicitly. I tried JLayeredPane, it seems to provide soln only for JPanel but not JDialog. Is there any neat solution to my problem ?
Regards,
Vijay
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Vijay,
No, there is no way to make a dialog modal to only a frame in Java. I don't know of any solution to your problem without writing some native code routines.
Regards,
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple modal dialogs
 
Similar Threads
JFrame vs JOptionPane
Modal dialogs
Multiple Modal Dialog's
Modal dialog problem with JApplet
To Modal, or not to Modal.....