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 Multiple Modal Dialog's 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 "Multiple Modal Dialog Watch "Multiple Modal Dialog New topic
Author

Multiple Modal Dialog's

Its Just Me
Greenhorn

Joined: Jan 10, 2002
Posts: 21
Hi everyone,
it may be simple to you, but I have the following problem.
I have a modal java.awt.Dialog. After a specified amount of time it creates another modal java.awt.Dialog, using a Thread.
Both Dialogs have a refference to the same parent (Frame).
Some time later, the second Dialog dissappears automatically, and again after some time it pops up again.
The problem is: I want both Dialogs to be modal. I know what you are thinking: they can't both be modal at the same time! I know that, but trying to transfer the "modality" (is this a word?) when the second Dialog dis- or appears, using the setModal(boolean)-method, seems not to be possible. Basically, this is what I do (wrong?):
1. create a modal java.awt.Dialog dialog1
2. after some time: dialog1.setModal(false);
3. create the other modal java.awt.Dialog dialog2
4. after some time: dialog2.setModal(false);
5. dialog2.dispose();
6. dialog1.setModal(true);
7. loop back to step 2.
this is what happens : the first Dialog shows up and is modal. Then the second one comes up, also modal. When the second Dialog disappears, the first one (which was still vissible in the background) is no longer modal.
What can I do to prevent this form happening? I want the Dialog's to "take turn at being modal"!
Please help...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Modal Dialog's
 
Similar Threads
Modal Dialog
key listener not detected
All Netscape/Mozilla windows blocking with Modal Dialogs
JDialog Dilemma I Have
Problem when multiple dialogs popped up at the same time?