Search code examples
javaswingawtswingutilitiesevent-queue

Difference between SwingUtilities Threads and AWT.EventQueue threads


I am using using the Netbeans 7 IDE to develop a GUI desktop application. When I create the JFrame class , Netbeans uses the

java.awt.EventQueue.invokeLater(new Runnable() { }

To initiate the runnable object. But my application has swing components as well.

I will like to know the difference between the

 java.awt.EventQueue threads

and

SwingUtilities threads

for GUI application development.


Solution

  • According to the doc here

    As of 1.3 SwingUtilities.invokeLater() method is just a cover for java.awt.EventQueue.invokeLater().

    Also the source of SwingUtilities here

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