Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane modal for only one window.

 
Karthick Dharani Vidhya
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dialog Modality
 
Steven Wall
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic