File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JDialog on JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JDialog on JDialog" Watch "JDialog on JDialog" New topic

JDialog on JDialog

Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
Hi there!

When my application loads, I show a modal JDialog. Then when I click a button on that JDialog, I want to show another dialog. But for some reason, when the first dialog is modal, the second dialog won't show at all. The first dialog has to be non modal for the second to show.

Here is the code where I am trying to show the second dialog.

Any suggestions would be greatly appreciated.

Many kind regards,
Arthur Griffith

Joined: Jan 06, 2005
Posts: 6
When a window is being displayed, and that window is modal, you can't do anything else. It has complete control of the windows and the mouse and no other window can get it. You can't have two modal windows at once because only one can have this control. I understand what you are trying to do, and it makes sense, but I think you have run afowl of the laws of modality.
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
I guess that kind of makes sense. It just seems silly that I can't have a modal dialog generate another modal dialog.

I agree. Here's the link:
subject: JDialog on JDialog
It's not a secret anymore!