<Swing Dev> RFR: 7190978: javax/swing/JComponent/7154030/bug7154030.java fails on mac [v2]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Wed Nov 4 02:44:58 UTC 2020


On Tue, 3 Nov 2020 18:38:15 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove uiScale
>
> test/jdk/javax/swing/JComponent/7154030/bug7154030.java line 96:
> 
>> 94:                     locx = screenSize.width/2;
>> 95:                     locy = screenSize.height/2;
>> 96:                     frame.setLocation(locx, locy);
> 
> To move it to the center you can use, setLocationRelativeTo(null) and you will need to get the actual bounds of the window(locx and locy might be ignored/tweaked by the OS)

I know setLocationRelativeTo(null) will move to center of screen but I needed the coordinate for robot interaction.
The locx,locy calculation to move to center of screen is done intentionally as we need to use the same coordinate in robot to capture the screen

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

PR: https://git.openjdk.java.net/jdk/pull/955


More information about the swing-dev mailing list