使用安全Component.repaint()EDT之外? [英] Safe to use Component.repaint() outside EDT?
问题描述
我找不到任何官方文件说,这是安全调用<一个href=\"http://docs.oracle.com/javase/6/docs/api/java/awt/Component.html#repaint%28%29\"><$c$c>Component.repaint$c$c>从另一个线程不是事件指派线程,EDT。
I cannot find any official documentation saying that it is safe to call Component.repaint
from another thread than the Event Dispatch Thread, the EDT.
这是这样的吗?和我在哪里可以找到一些文档/ code?
Is this so? And where can I find some documentation/code?
推荐答案
下面是一个的从官方网页报价说明:
以下的JComponent方法是安全的,从任何线程调用: 重绘()
,重新验证()
,
和无效()
。在重绘()
和重新验证()
方法队列请求
事件派发线程调用的paint()
和的validate()
,分别为。
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:
既然提到的previous链接已被转移。我张贴一个新的链接,虽然它可能需要多一点时间真的知道这个网页的真实性,因为它似乎是从的Java
虽然它源于一些大学
S服务器,这可以从地址栏上看到。
Since the previous link mentioned has been shifted. I am posting a new link, though it might take a bit more time to actually know the authenticity of this page, since it appears to be from Java
though it originated from some University
's server, as can be seen from the address bar.
这篇关于使用安全Component.repaint()EDT之外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!