I have a swing application, basically the main frame, which can bring up a modal dialog. When a modal dialog is displayed, if I switch to another window, for example, firefox. Then go back to the download application. JDialog no longer in front.
I do not want the AlwaysOnTop dialog to be right. because then the dialog will be on top of all windows, including windows in another process.
So what should I do so that when I go back, the modal dialogue is still on top?
BTW: this is an applet, so the main frame is actually set this way:
private static Frame findParentFrame(Container owner){ Container c = owner; while(c != null){ if (c instanceof Frame) return (Frame)c; c = c.getParent(); } return (Frame)null; }
source share