in the book that i'm reading, every example of GUI with multithreading has something like that:
public static void main(String[] args) throws Exception
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
JFrame frame = new SomeKindOfFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
(i mean EventQueue). but isn't the code automatically executed in the main (EDT) thread?
Runnable()
instances and runs them. – Concordia