On Fri, 31 Mar 2023 18:29:01 GMT, Phil Race <[email protected]> wrote:

> Even for AWT (non-swing) apps, it is recommended to do it on the EDT to avoid 
> threading issues - such as this. Lots of apps do use the main thread, and 
> have no issues but that's not guaranteed.
> 
> I can't find where this is documented .. I do remember it was quite a number 
> of years ago that this advice was first offered.

I tried to find any documentation stating the threading model for AWT 
components but I didn't find any. I presume AWT should be thread-safe. A couple 
of times on code review I saw it had been proposed to drop 
`EventQueue.invokeLater` because creating and changing AWT components from main 
thread is _safe_.

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

PR Comment: https://git.openjdk.org/jdk/pull/13263#issuecomment-1518078254

Reply via email to