RFR: 8017175: [TESTBUG] javax/swing/JPopupMenu/4634626/bug4634626.java sometimes failed on mac [v2]
Sergey Bylokhov
serb at openjdk.java.net
Thu Oct 28 01:40:13 UTC 2021
On Wed, 27 Oct 2021 10:28:32 GMT, Alexander Zuev <kizune at openjdk.org> wrote:
>> Unfortunately the creation should be dine on EDT as well
>
>> Unfortunately the creation should be dine on EDT as well
>
> Why? Neither component or frame has peers assigned, not like their status is being changed by another thread and they do not receive any events from EDT yet. Then what is the reason for moving component creation to EDT?
It does not relate to the peers(actually peers and awt components can be used on different threads), it is just a requirement for the Swing library all its api should be used only on the EDT, otherwise too many things can go wrong, which includes the simple visibility across the threads, and more complex out of order events execution - when you created a component on main thread it can post an event to EDT, and that event will be executed in parallel with your code on main.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6104
More information about the client-libs-dev
mailing list