On Wed, 7 Jun 2023 11:19:38 GMT, Alexey Ivanov <[email protected]> wrote:

>> Updated
>
> It doesn't feel right this way either. A cleaner approach would be to pass 
> the undecorated file name and add the extension and specify the format inside 
> `captureScreen`. (Passing the same value as a parameter usually produces an 
> IDE warning, which means the parameter is not necessary.)
> 
> 
> captureScreen("Img_5");
> 
> ImageIO.write(
>         robot.createScreenCapture(new Rectangle(0, 0, screenSize.width, 
> screenSize.height)),
>         "png",
>         new File(filename + ".png")
> );

Updated.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14289#discussion_r1222136262

Reply via email to