File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
visualvm/startup/src/org/graalvm/visualvm/modules/startup/dialogs Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,16 @@ public final class StartupDialog {
56
56
57
57
public static JDialog create (String caption , String message , int messageType ) {
58
58
// Bugfix #361, set the JDialog to appear in the Taskbar on Windows (ModalityType.APPLICATION_MODAL)
59
- Window [] windows = Window .getWindows ();
60
- final JDialog d = windows == null || windows .length == 0 ?
59
+ Window parent = null ;
60
+ for (Window window : Window .getWindows ()) {
61
+ if (window .isVisible () && window .isShowing ()) {
62
+ parent = window ;
63
+ break ;
64
+ }
65
+ }
66
+ final JDialog d = parent == null ?
61
67
new JDialog (null , caption , JDialog .ModalityType .APPLICATION_MODAL ) :
62
- new JDialog ((Frame )null , caption , true );
68
+ new JDialog ((Frame )null , caption , true ); // NOTE: should a (Frame)parent be used here?
63
69
64
70
if (message != null ) initDialog (d , message , messageType );
65
71
You can’t perform that action at this time.
0 commit comments