< prev index next >

test/java/awt/Mixing/HWDisappear.java

Print this page




  92         Robot robot = Util.createRobot();
  93         robot.setAutoDelay(20);
  94 
  95         Util.waitForIdle(robot);
  96 
  97         // Move quite far to ensure the button is hidden completely
  98         f.setLocation(500, 200);
  99 
 100         Util.waitForIdle(robot);
 101 
 102         // Activate the menu
 103         Point lLoc = lmenu.getLocationOnScreen();
 104         robot.mouseMove(lLoc.x + 5, lLoc.y + 5);
 105 
 106         robot.mousePress(InputEvent.BUTTON1_MASK);
 107         robot.mouseRelease(InputEvent.BUTTON1_MASK);
 108         Util.waitForIdle(robot);
 109 
 110         // Click on the button.
 111         Point bLoc = b.getLocationOnScreen();
 112         robot.mouseMove(bLoc.x + b.getWidth() / 2, bLoc.y + 5);




 113 
 114         robot.mousePress(InputEvent.BUTTON1_MASK);
 115         robot.mouseRelease(InputEvent.BUTTON1_MASK);
 116         Util.waitForIdle(robot);
 117 
 118         if (clickPassed) {
 119             pass();
 120         } else {
 121             fail("The button cannot be clicked.");
 122         }
 123     }//End  init()
 124 
 125 
 126 
 127     /*****************************************************
 128      * Standard Test Machinery Section
 129      * DO NOT modify anything in this section -- it's a
 130      * standard chunk of code which has all of the
 131      * synchronisation necessary for the test harness.
 132      * By keeping it the same in all tests, it is easier




  92         Robot robot = Util.createRobot();
  93         robot.setAutoDelay(20);
  94 
  95         Util.waitForIdle(robot);
  96 
  97         // Move quite far to ensure the button is hidden completely
  98         f.setLocation(500, 200);
  99 
 100         Util.waitForIdle(robot);
 101 
 102         // Activate the menu
 103         Point lLoc = lmenu.getLocationOnScreen();
 104         robot.mouseMove(lLoc.x + 5, lLoc.y + 5);
 105 
 106         robot.mousePress(InputEvent.BUTTON1_MASK);
 107         robot.mouseRelease(InputEvent.BUTTON1_MASK);
 108         Util.waitForIdle(robot);
 109 
 110         // Click on the button.
 111         Point bLoc = b.getLocationOnScreen();
 112         robot.mouseMove(bLoc.x + b.getWidth() / 2, bLoc.y + b.getHeight() / 2);
 113 
 114         robot.mousePress(InputEvent.BUTTON1_MASK);
 115         robot.mouseRelease(InputEvent.BUTTON1_MASK);
 116         Util.waitForIdle(robot);
 117 
 118         robot.mousePress(InputEvent.BUTTON1_MASK);
 119         robot.mouseRelease(InputEvent.BUTTON1_MASK);
 120         Util.waitForIdle(robot);
 121 
 122         if (clickPassed) {
 123             pass();
 124         } else {
 125             fail("The button cannot be clicked.");
 126         }
 127     }//End  init()
 128 
 129 
 130 
 131     /*****************************************************
 132      * Standard Test Machinery Section
 133      * DO NOT modify anything in this section -- it's a
 134      * standard chunk of code which has all of the
 135      * synchronisation necessary for the test harness.
 136      * By keeping it the same in all tests, it is easier


< prev index next >