< prev index next >

test/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java

Print this page

        

@@ -54,21 +54,28 @@
             public void run() {
                 constructTestUI();
             }
         });
 
-        Util.waitForIdle(null);
+        Robot testRobot = null;
         try {
+            testRobot = new Robot();
+        } catch(AWTException ex) {
+            throw new RuntimeException("Error while creating Robot");
+        }
+
+        Util.waitForIdle(testRobot);
+
             Point loc = textArea.getLocationOnScreen();
-            Util.drag(new Robot(),
+        Util.drag(testRobot,
                     new Point((int) loc.x + 3, (int) loc.y + 3),
                     new Point((int) loc.x + 40, (int) loc.y + 40),
                     InputEvent.BUTTON1_MASK);
-        } catch (AWTException ex) {
-            throw new RuntimeException("Could not initiate a drag operation");
-        }
-        Util.waitForIdle(null);
+
+        Util.waitForIdle(testRobot);
+        
+        testRobot.delay(200);
     }
 
     private static void constructTestUI() {
         final JFrame frame = new JFrame("Test frame");
         textArea = new JTextArea("Drag Me!");
< prev index next >