Is it valid to call JComponent#paintImmediately on a non-EDT thread (yet)?
Nikita Provotorov
nikita.provotorov at jetbrains.com
Thu Nov 16 00:01:08 UTC 2023
Hello!
I've discovered that on X11 platforms a call
of java.awt.TextComponent#setText can lead to a call
of javax.swing.JComponent#paintImmediately(java.awt.Rectangle) on the same
thread.
Since java.awt.TextComponent#setText is allowed to be called on any thread
(because it's AWT, not Swing), JComponent#paintImmediately may be called
outside of EDT. Is this a valid behavior?
The following stacktrace shows how exactly this can happen:
> at javax.swing.JComponent.paintImmediately
> at sun.awt.X11.XTextAreaPeer$AWTTextArea.repaintNow
> at sun.awt.X11.XTextAreaPeer.repaintText
> at sun.awt.X11.XTextAreaPeer.setText
> at java.awt.TextComponent.setText
Best regards,
Nikita Provotorov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20231116/f0f45d6e/attachment.htm>
More information about the client-libs-dev
mailing list