test/java/awt/List/ScrollOutside/ScrollOut.java

Print this page

        

*** 31,41 **** @run main ScrollOut */ import java.awt.*; import java.awt.event.*; - import sun.awt.SunToolkit; import test.java.awt.regtesthelpers.Util; public class ScrollOut { public static final void main(String args[]) --- 31,40 ----
*** 52,84 **** frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); - ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); try{ robot = new Robot(); }catch(AWTException e){ throw new RuntimeException(e); } //Drag from center to the outside on left Point from = new Point(list.getLocationOnScreen().x + list.getWidth()/2, list.getLocationOnScreen().y + list.getHeight()/2); Point to = new Point(list.getLocationOnScreen().x - 30, from.y); ! ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); ! ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); //Drag from center to the outside on up to = new Point(from.x, list.getLocationOnScreen().y - 50); ! ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); }//End init() } --- 51,83 ---- frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); try{ robot = new Robot(); }catch(AWTException e){ throw new RuntimeException(e); } + robot.waitForIdle(); //Drag from center to the outside on left Point from = new Point(list.getLocationOnScreen().x + list.getWidth()/2, list.getLocationOnScreen().y + list.getHeight()/2); Point to = new Point(list.getLocationOnScreen().x - 30, from.y); ! robot.waitForIdle(); Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); ! robot.waitForIdle(); //Drag from center to the outside on up to = new Point(from.x, list.getLocationOnScreen().y - 50); ! robot.waitForIdle(); Util.drag(robot, from, to, InputEvent.BUTTON1_MASK); }//End init() }