SwingUtilities.invokeLater() vs EventQueue.invokeLater()

JavaSwing

Java Problem Overview


Are there any differences between EventQueue.invokeLater() and SwingUtilities.invokeLater()?

Or is that the latter is just built on top of the former (with no modifications) for the sake of design?

Java Solutions


Solution 1 - Java

No there is no difference.

SwingUtilities class was built to combine all general utility methods used in swing to be in one single class. Internally SwingUtilities.invokeLater() calls EventQueue.invokeLater()

1197    public static void invokeLater(Runnable   doRun) {
1198       EventQueue.invokeLater(doRun);
1199    }

Reference: http://kickjava.com/src/javax/swing/SwingUtilities.java.htm

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionedgarView Question on Stackoverflow
Solution 1 - JavaHarry JoyView Answer on Stackoverflow