Safe to use Component.repaint() outside EDT?

前端 未结 3 1701
误落风尘
误落风尘 2020-12-03 06:49

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.

Is this so? A

3条回答
  •  无人及你
    2020-12-03 07:34

    about the experiences on this forum

    (+1 for both answerers) but, I think that not possible to answering your question correctly, part of methods Graphics(2D) required call for repaint() programatically, rest of them implementing this method (in API) directly (sure some of them missing this method in API)

    for part of Swing JComponents is maybe better to dis-agree, this forum is full of questions about Concurency in Swing, starting with Graphics(2D) thought JTextComponents, JTree, and ends (same way is declared as thread safe) with setText(),

    about Concurency in Swing are there notable numbers of questions

提交回复
热议问题