使用Java的JFrame库,以下两者效果明明一样,很好奇为什么不直接
LoginWindow frame = new LoginWindow();
frame.setVisible(true);
而是
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LoginWindow frame = new LoginWindow();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
http://www.360doc.com/content/17/1107/23/49369095_701807039.shtml
这个解释很通俗易懂