I have a JFrame that spawns two JDialogs. Each of the three windows needs to be focusable (and are the way I currently have it written) but that JFrame won't go atop the dialogs. When you click on either dialog, they'll pop on top of each other (like one would expect), but that JFrame just refuses to come to the front.
I need them to remain JDialogs (as opposed to being JFrames themselves) since most of the current behavior is desirable (i.e. when another window/application blocks any or all of the windows, if you select any of the windows they all come to the front (whereas three JFrames would result in only the selected one coming forward)).
My JDialogs constructors are to this effect:
SubDialog(JFrame parent /*, a handful, ofOther arguments */){
super(parent, ModalityType.MODELESS); //not even the modeless helped
setAlwaysOnTop(false); //not even the not always on top helped
setUndecorated(true); //maybe this has something to do with it (unlikely, just fyi)?
//some simple variable assignments
}
I even tried tossing a setAlwaysOnTop(true)
in my JFrame. No dice. I was getting desperate and even tried one of these numbers:
MyJFrame(String title){
super(title);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addWindowFocusListener(new WindowAdapter(){
public void windowGainedFocus(WindowEvent e){
final Window w = e.getWindow();
//PLEASE come to the front
w.toFront();
//even MOAR desperation
SwingUtilities.invokeLater(new Runnable(){
public void run(){
w.toFront(); //STILL no dice.
}
});
}
});
}
Thoughts? I got nothin'.