Uploaded February 2017 | Updated November 2026, 18 hours ago
In this video, I have made a JavaFX program that can take Screenshots. Screenshots can be taken using the java.awt.Robot class's createScreenCapture(Rectangle area) function.
The Rectangle parameter specify the area that should be covered in the screenshot. Using java.awt.Toolkit, we can find the size of screen directly or you can specify your own area.
In order to display the screenshot in javafx image view, we have to convert BufferedImage into javafx.scene.Image. This can be done using SwingFXUtils from javafx.embed.swing package.
ImageIO class helps to write the image into an image file
- Genuine Coder
genuinecoder.com
In this video, I have made a JavaFX program that can take Screenshots. Screenshots can be taken using the java.awt.Robot class's createScreenCapture(Rectangle area) function.
The Rectangle parameter specify the area that should be covered in the screenshot. Using java.awt.Toolkit, we can find the size of screen directly or you can specify your own area.
In order to display the screenshot in javafx image view, we have to convert BufferedImage into javafx.scene.Image. This can be done using SwingFXUtils from javafx.embed.swing package.
ImageIO class helps to write the image into an image file
- Genuine Coder
genuinecoder.com










