Use Robot#createScreenCapture()
.
BufferedImage image = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(image, "png", new File("/screenshot.png"));
More Related Contents:
- refreshing background color for a row in jtable
- What’s the difference between JPA and Hibernate? [closed]
- Can Java 8 code be compiled to run on Java 7 JVM?
- What is the solution for the N+1 issue in JPA and Hibernate?
- Android RecyclerView addition & removal of items
- Java 7 (JDK 7) garbage collection and documentation on G1
- Sorting using Comparator- Descending order (User defined classes) [closed]
- Leaking this in constructor warning
- Spring Data JPA Update @Query not updating?
- Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?
- what is @JoinColumn and how it is used in Hibernate
- Updating version numbers of modules in a multi-module Maven project
- A for-loop to iterate over an enum in Java
- Building a runnable jar with Maven 2
- How to click on hidden element in Selenium WebDriver?
- Gson Java reserved keyword
- How to verify element present or visible in selenium 2 (Selenium WebDriver)
- Tree implementation in Java (root, parents and children)
- What is JAVA_HOME? How does the JVM find the javac path stored in JAVA_HOME?
- How do you create a dictionary in Java? [closed]
- RegEx in Java: how to deal with newline
- Java – GUI clock using large amounts of RAM?
- Send mail to multiple recipients in Java
- Better way to find index of item in ArrayList?
- Is WEB-INF in the CLASSPATH?
- Comparing a string with the empty string (Java)
- How to connect to a remote MySQL database with Java?
- Are Java 8 lambdas compiled as inner classes, methods or something else? [duplicate]
- Selenium get .har file
- who and when notify the thread.wait() when thread.join() is called?