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 question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JOptionPane question" Watch "JOptionPane question" New topic

JOptionPane question

Satheesh Thekku Veethil

Joined: Jan 31, 2002
Posts: 25
I have a situation here.
I have an application which is made up of two process. Each process displays a JFrame which has user interface components in them.
Now I have an issue in displaying a modal popup. I used a JOptionPane which takes the parent frame as its containter. In which case it is modal with respect to that specific parent frame.
Obviously I cannot make it modal with respect to the second frame (from the second process). So what as a solution is to restrict the motion (the user dragging the popup) to the parent frame only.
Any suggestions as to how I can achieve this?
Any ideas or any other suggestions for getting a modal popup across the two frames??
Please reply asap
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Here's the secret to getting a dialog (I assume that you meant dialog instead of popup... Popups aren't modal... ) to be modal across two frames... use dialogs instead!

Here's some code that illustrates this...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: JOptionPane question
It's not a secret anymore!