< prev index next >

test/sun/awt/dnd/8024061/bug8024061.java

Print this page

        

*** 85,94 **** --- 85,96 ---- e.printStackTrace(); } DropObjectFlavor = flavor; } + private static Point point; + bug8024061() { frame = new JFrame("DnDWithRobot"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); Dimension d = new Dimension(100, 100);
*** 124,139 **** } }); final Robot robot = new Robot(); robot.setAutoDelay(10); robot.waitForIdle(); JFrame frame = dnd[0].frame; ! Point point = frame.getLocationOnScreen(); Point here = new Point(point.x + 35, point.y + 45); Point there = new Point(point.x + 120, point.y + 45); ! here.x += 25; robot.mouseMove(here.x, here.y); robot.mousePress(InputEvent.BUTTON1_MASK); while (here.x < there.x) { here.x += 20; robot.mouseMove(here.x, here.y); --- 126,142 ---- } }); final Robot robot = new Robot(); robot.setAutoDelay(10); robot.waitForIdle(); + robot.delay(200); JFrame frame = dnd[0].frame; ! SwingUtilities.invokeAndWait(() -> point = frame.getLocationOnScreen()); Point here = new Point(point.x + 35, point.y + 45); Point there = new Point(point.x + 120, point.y + 45); ! here.x += 20; robot.mouseMove(here.x, here.y); robot.mousePress(InputEvent.BUTTON1_MASK); while (here.x < there.x) { here.x += 20; robot.mouseMove(here.x, here.y);
< prev index next >