I have trouble understanding this simple code:
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
Can anybody please explain me how it works (in simple terms because I am a newbie)? This short code is a part of this larger code.
To be more specific, I have the following questions:
- Does "public void run" define a new method? If it is the case, why it is defined within another method (see "larger code" for reference)?
- If "public void run" defines a new methods, what is a reason to define a method containing only one line of code (createAndShowGUI)?
- What does "invokeLater" do? This is actually the most complicated question for me.
I would like to emphasize one more time that I am a newbie and usage of "special" and "technical" words will produce even more questions.
Thank you in advance, if you decide to help me!