< prev index next >

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

Print this page

        

*** 54,74 **** public void run() { constructTestUI(); } }); ! Util.waitForIdle(null); try { Point loc = textArea.getLocationOnScreen(); ! Util.drag(new Robot(), 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); } private static void constructTestUI() { final JFrame frame = new JFrame("Test frame"); textArea = new JTextArea("Drag Me!"); --- 54,81 ---- public void run() { constructTestUI(); } }); ! Robot testRobot = null; try { + testRobot = new Robot(); + } catch(AWTException ex) { + throw new RuntimeException("Error while creating Robot"); + } + + Util.waitForIdle(null); + Point loc = textArea.getLocationOnScreen(); ! 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); ! Util.waitForIdle(null); + + testRobot.delay(200); } private static void constructTestUI() { final JFrame frame = new JFrame("Test frame"); textArea = new JTextArea("Drag Me!");
< prev index next >