Java Swing Tutorial - Java Robot .setAutoWaitForIdle (boolean isOn)








Syntax

Robot.setAutoWaitForIdle(boolean isOn) has the following syntax.

public void setAutoWaitForIdle(boolean isOn)

Example

In the following code shows how to use Robot.setAutoWaitForIdle(boolean isOn) method.

//from w ww.  ja v a 2 s .c o m
import java.awt.Robot;

public class Main {
  public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    robot.setAutoWaitForIdle(true);
    System.out.println(robot.isAutoWaitForIdle());
    
  }
}

The code above generates the following result.