Hi
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
frame.setVisible(true);
}
});
When create a Frame using netBeans, netBeans automatically add this code.
As I understand from previous reading, there is always Event-Dispatch
thread where events are fired and handled. I assumed that EventQueue is the responsible to queue and fire events on the event-dispatch thread!!
Is that correct?
The run method in the above code is executing in Event-Dispatch thread...Why I would want to do that?? what happens if code runs in the main thread??
I think this is common question, however I did not find it!!
Thanks