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 JOptionPane modal for only one window. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JOptionPane modal for only one window." Watch "JOptionPane modal for only one window." New topic

JOptionPane modal for only one window.

Karthick Dharani Vidhya
Ranch Hand

Joined: Feb 23, 2008
Posts: 91

In my application, I have a MAIN FRAME. I bring up a non-modal dialog whose parent will be this MAIN FRAME. When user performs a operation on this dialog and if it is not valid then one JOptionDialog is shown that will have the error message and a 'OK' button. This OptionPanes's parent is set to Dialog.

Now this JOptionPane blocks the input for the whole Application. If i want to block the input only for the Dialog. How do we do it?

Karthick D V
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Dialog Modality
Steven Wall

Joined: Nov 04, 2007
Posts: 22
We have been interested in this issue too, so I was anxious to see the response. As far as I can tell, the JDialog constructors only allow a JFrame or Window as it's "owner", so they cannot be used with JInternalFrame as a parent.

I agree. Here's the link:
subject: JOptionPane modal for only one window.
It's not a secret anymore!