This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Similar Threads
Adding a Container Listener to a panel
modeless JDialog?
problem with showMessageDialog
Problem refreshing a panel
return a value by firing a JButton event