On Thu, 3 Oct 2024 08:16:46 GMT, Jayathirth D V <[email protected]> wrote:

>> test/jdk/java/awt/Window/InvalidFocusLostEventTest/InvalidFocusLostEventTest.java
>>  line 90:
>> 
>>> 88:         robot.setAutoWaitForIdle(true);
>>> 89:         EventQueue.invokeAndWait(() -> bp = b.getLocationOnScreen());
>>> 90:         robot.mouseMove(bp.x + b.getWidth() / 2, bp.y + b.getHeight() / 
>>> 2 );
>> 
>> button width and height should be accessed on EDT?
>
> I am not sure whether we need to use EDT even for getting information of 
> already drawn UI Components.
> I was under the impression that only for UI updates we need to use EDT.
> 
> Now i am not sure whether we need to use EDT for getLocationOnScreen() also. 
> Most of the already present tests don't use EDT for only getting information 
> related to already rendered UI components.

There are several tests which accessed UI components on EDT to get information 
and as per review comments it has been advised to do so. So, I thought 
`getWidth()` and `getHeight()` should also be accessed on EDT.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21281#discussion_r1785840984

Reply via email to