I have a JFrame that spawns two JDialogs. Each of the three windows must be configured (and, as I already wrote at the moment), but the JFrame will not go through the dialogs. When you click on any dialog, they will pop up one above the other (as one would expect), but the JFrame simply refuses to go to the front.
I need them to remain JDialogs (unlike JFrames themselves), since most of the current behavior is desirable (i.e. when another window / application blocks any or all windows, if you select any of the windows, they will all come to the front (whereas three JFrames will cause only the selected one to move forward)).
My JDialogs constructors have this effect:
SubDialog(JFrame parent ){
super(parent, ModalityType.MODELESS);
setAlwaysOnTop(false);
setUndecorated(true);
}
I even tried tossing setAlwaysOnTop(true)in my JFrame. No dice. I was getting desperation 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();
w.toFront();
SwingUtilities.invokeLater(new Runnable(){
public void run(){
w.toFront();
}
});
}
});
}
Thoughts? I said nothing.
source
share