< prev index next >

test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java

Print this page

        

@@ -64,11 +64,11 @@
     }
 
     public void start() {
         showButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
-                testToplevel.setVisible(true);
+                Util.showWindowWait(testToplevel);
             }
         });
         nofocusFrame.add(showButton);
         nofocusFrame.pack();
         nofocusFrame.setFocusableWindowState(false);

@@ -96,14 +96,16 @@
         toplevel.pack();
         toplevel.setLocation(400, 200);
 
         switch (stage) {
             case 1:
-                toplevel.setVisible(true);
+                Util.showWindowWait(toplevel);
                 break;
             case 2:
                 testToplevel = toplevel;
+                Util.showWindowWait(nofocusFrame);
+                Util.waitForIdle(robot);
                 Util.clickOnComp(showButton, robot);
                 break;
         }
         Util.waitForIdle(robot);
 
< prev index next >