Quote form the Swing Tutorial
Some Swing component methods are labelled "thread safe" in the API specification; these can be safely invoked from any thread. All other Swing component methods must be invoked from the event dispatch thread.
And on the same page some lines below
If you need to determine whether your code is running on the event dispatch thread, invoke
javax.swing.SwingUtilities.isEventDispatchThread
.
So thread-safe methods like SwingUtilities.invokeLater
are "labeled" with a text like this:
Unlike the rest of Swing, this method can be invoked from any thread.
But the API documentation for SwingUtilities.isEventDispatchThread()
does not "label it" as thread-safe.
Returns true if the current thread is an AWT event dispatching thread.
This would mean that I may call it only on the event dispatch thread. But that doesn't make any sense, so I'm pretty sure the method is thread-safe.
Right?
Is there any confirmation for this on the web?