The following code executes fine:
public static void main(String [] args) {
Runnable r = new Runnable() {
public void run() {
createGUI();
}
} ;
javax.swing.SwingUtilities.invokeLater(r);
}
I am curious why the following code will not compile:
import javax.swing.SwingUtilities;
public static void main(String [] args) {
Runnable r = new Runnable() {
public void run() {
createGUI();
}
} ;
invokeLater(r);
}
What is the differenc between javax.swing.SwingUtilities.invokeLater(r);
and import javax.swing.SwingUtilities; invokeLater(r);