我有一个简单的问题,为什么我需要Swing GUI的一个简单的事情
SwingUtilities.invokeLater(new Runnable(){
写这样的代码如果PROGRAMM没有它创建相同的帧?
代码SwingUtilities的
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class App {
public static void main (String args[]){
SwingUtilities.invokeLater(new Runnable(){
public void run() {
JFrame frame = new JFrame("Hello world swing");
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 400);
}
});
}
}
代码而不荡工具。
import javax.swing.JFrame;
public class App {
public static void main (String args[]){
JFrame frame = new JFrame("Hello world swing");
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 400);
}
}
我猜[Swing中的并发](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/),可以用更好的方式解释这件事:-) –
下一次使用更好的标题为你的问题。我有同样的问题,但没有找到你的问题,因为不好的标题;-) 这是我的问题:http://stackoverflow.com/questions/18976990/best-practice-to-start-a-swing -application – Charmin