Package java.awt

Examples of java.awt.Robot


    loc.x += i.left + bounds.x;
    loc.y += i.top + bounds.y;
    bounds.x += i.left;
    bounds.y += i.top;
   
    Robot r = harness.createRobot();
    Color scroll = r.getPixelColor(loc.x + bounds.width - i.left, loc.y + bounds.height/2);
   
    // Check if scrollbar was painted.
    harness.check(!(scroll.equals(Color.white)));
    harness.check(!(scroll.equals(Color.red)));
   
    // There is a delay to avoid any race conditions   
    // and so user can see frame
    r.waitForIdle();
    r.delay(1000);
  }
View Full Code Here


      public void run()
      {
        try
          {
            shouldStop = false;
            Robot robot = new Robot();

            for (;;)
              {
                for (int i = start; i < end; i++)
                  {
                    if (shouldStop)
                      break;
                   
                    robot.mouseMove(150, i);
                    yield();
                  }
                for (int i = end; i > start; i--)
                  {
                    if (shouldStop)
                      break;
                   
                    robot.mouseMove(150, i);
                    yield();
                  }
                if (shouldStop)
                  break;
              }
View Full Code Here

    l.setVisible(false);
    f.add(l);
    f.add(t);
    f.show();
   
    Robot r = harness.createRobot();
    r.waitForIdle();
    r.delay(1000);
   
    Point po = l.getLocation();
    harness.check(t.isVisible(), true);
    harness.check(f.isVisible(), true);
    harness.check(l.isVisible(), false);
View Full Code Here

    Insets i = f.getInsets();
    Point loc = f.getLocationOnScreen();
    loc.x += i.left + bounds.x;
    loc.y += i.top + bounds.y;
   
    Robot r = harness.createRobot();
    Color scroll = r.getPixelColor(loc.x + bounds.width - i.left, loc.y + bounds.height/2);
    harness.check(!(scroll.equals(Color.red)));
   
    // There is a delay to avoid any race conditions   
    // and so user can see frame
    r.waitForIdle();
    r.delay(2000);
  }
View Full Code Here

    Point loc = f.getLocationOnScreen();
    Insets i = f.getInsets();
    bounds.x += loc.x + i.left;
    bounds.y += loc.y + i.top;
   
    Robot r = harness.createRobot();
    Color text = r.getPixelColor(bounds.x + bounds.width/2, bounds.y + bounds.height/2);
    harness.check(text.equals(Color.white));

    // There is a delay to avoid any race conditions   
    // and so user can see frame
    r.waitForIdle();
    r.delay(1000);
  }
View Full Code Here

    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    bounds.x += i.left + loc.x;
    bounds.y += i.top + loc.y;
   
    Robot r = harness.createRobot();
    Color check = r.getPixelColor(bounds.x + bounds.width/2, bounds.y + bounds.height/2);
    harness.check(check.equals(Color.blue));
   
    // There is a delay to avoid any race conditions   
    // and so user can see frame
    r.waitForIdle();
    r.delay(1000);
  }
View Full Code Here

    frame = new JFrame();
    frame.setSize(200, 200);
    frame.getContentPane().add(text);
    frame.show();
   
    robot = new Robot();
    robot.setAutoDelay(50);
    robot.delay(500);
  }
View Full Code Here

    frame = new JFrame();
    frame.setSize(200, 200);
    frame.getContentPane().add(text);
    frame.show();
   
    robot = new Robot();
    robot.setAutoDelay(50);
    robot.delay(500);
  }
View Full Code Here

    DefaultTreeModel model = new DefaultTreeModel(root);
    tree.setModel(model);
    tree.setEditable(true);

    r = new Robot();
    r.setAutoDelay(50);
    r.delay(500);
  }
View Full Code Here

    }

    private BufferedImage getDesktopScreenshot() {
        try {
            Robot robot = new Robot();
            Rectangle captureSize = new Rectangle(screenBounds);
            return robot.createScreenCapture(captureSize);
        } catch (AWTException e) {
            logger.error("Exception occured while taking screenshot for video record", e);
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.Robot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.