Remove Thread.sleep from how to make a screenshot example
This commit is contained in:
parent
f4d6384654
commit
fe0d1c0b4a
|
@ -14,7 +14,6 @@ public class Screenshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getScreenshot(int timeToWait) throws Exception {
|
public void getScreenshot(int timeToWait) throws Exception {
|
||||||
Thread.sleep(timeToWait);
|
|
||||||
Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
BufferedImage img = robot.createScreenCapture(rectangle);
|
BufferedImage img = robot.createScreenCapture(rectangle);
|
||||||
|
|
Loading…
Reference in New Issue