Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Problem with two Dialogs sharing a parent Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Problem with two Dialogs sharing a parent" Watch "Problem with two Dialogs sharing a parent" New topic
Author

Problem with two Dialogs sharing a parent

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
I have an applet which appears as a button, and when the user clicks on it, a modal Dialog (mainDialog) is opened.

When certain events occur on mainDialog, a smaller modal Dialog (subDialog) appears.

Both Dialogs have the applet frame as their parents, and the problem is that input is be blocked to subDialog when it is shown.

I have tried to call mainDialog.setModal(false) just before subDialog is constructed and displayed, but it has no effect. (However, just to test, when making mainDialog non-modal at construction everything works fine).

Does anyone have the solution workaround for how I can make these two modal Dialogs successfully share the same parent?

Thanks in advance,
James
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24051
    
  13

Shouldn't the main dialog be the parent of the subdialog?


[Jess in Action][AskingGoodQuestions]
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Ernest, thanks for the reply. Unfortunately I'm working with JDK1.1 so the parent must be a Frame...
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem with two Dialogs sharing a parent
 
Similar Threads
Closing parent and child with ESC
Problem when multiple dialogs popped up at the same time?
All Netscape/Mozilla windows blocking with Modal Dialogs
Multiple Modal Dialog's
Applet dialog not getting focus when coming back to screen using Alt-Tab