我找不到任何官方文件表明调用 Component.repaint
是安全的来自除事件调度线程之外的另一个线程,即 EDT。
是这样吗?我在哪里可以找到一些文档/代码?
最佳答案
这里是 quote from an official page声明:
The following JComponent methods are safe to call from any thread:
repaint()
,revalidate()
, andinvalidate()
. Therepaint()
andrevalidate()
methods queue requests for the event-dispatching thread to callpaint()
andvalidate()
, respectively.
编辑 1:
由于前面提到的链接已经转移。我正在发布 new link , 虽然实际知道此页面的真实性可能需要更多时间,因为它似乎来自 Java
,尽管它来自某些 University
的服务器,如从地址栏可以看到。
关于java - 在 EDT 外使用 Component.repaint() 安全吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9786497/