On Mon, 10 Oct 2022 06:50:41 GMT, Manukumar V S <[email protected]> wrote:

>> test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 148:
>> 
>>> 146:         try {
>>> 147:             ImageIO.write(robot.createScreenCapture(
>>> 148:                     new Rectangle(0, 0, screenSize.width, 
>>> screenSize.height)),
>> 
>> This may capture the default screen while the frame is currently visible on 
>> another one.
>
> But, is there any way we can capture the current screen where the frame is 
> displayed?

You can pass coordinates/bounds of that screen to the createScreenCapture.

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

PR: https://git.openjdk.org/jdk/pull/10606

Reply via email to