What's the difference between using SwingUtilities.invokeLater (Runnable) and EventQueue.invokeLater (Runnable) when invoking a window?

2

I was reading this answer where you talk about using EDT to manipulate swing components, but there it is suggested to use one of the two methods quoted to" dispatch "the interface to EDT. >

There is a difference between using SwingUtilities.invokeLater(Runnable) or EventQueue.invokeLater(Runnable) ? Is there a situation where it is better to use one or the other?

    
asked by anonymous 11.01.2017 / 14:05

1 answer

4

There is no difference. The SwingUtilities.invokeLater(Runnable) only directs EventQueue.invokeLater(Runnable) directly.

See this directly from the source code of the SwingUtilities class of JDK :

public static void invokeLater(Runnable doRun) {
    EventQueue.invokeLater(doRun);
}
    
11.01.2017 / 14:57