java.awt.EventQueue.invokeLater explained
问题 I am very curious why do we have to use java.awt.EventQueue.invokeLater to control swing components. Why can't we do that in normal thread? What exactly is going on behind the scenes? From what I have noticed if I have a JFrame I can set visibility to true or false from the main thread without getting any errors, and it does seem to work. So what exactly do I achieve by using java.awt.EventQueue.invokeLater ? I am also fully aware that I can use SwingUtilities.invokeLater but as explained