Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safe to use Component.repaint() outside EDT?

Tags:

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? And where can I find some documentation/code?

like image 374
dacwe Avatar asked Mar 20 '12 12:03

dacwe


1 Answers

Here is a quote from an official page stating that:

The following JComponent methods are safe to call from any thread: repaint(), revalidate(), and invalidate(). The repaint() and revalidate() methods queue requests for the event-dispatching thread to call paint() and validate(), respectively.

EDIT 1 :


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.

like image 130
nIcE cOw Avatar answered Oct 12 '22 14:10

nIcE cOw