Java Swing 中使用 EventQueue

 

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() { 
        public void run() {
            try {
                new Loginform().setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

 

在Java中Swing是线程不安全的,是单线程的设计

https://blog.csdn.net/qq_15037231/article/details/69102297

https://blog.csdn.net/m0_37732829/article/details/80515663

 

posted on 2018-11-28 14:29  0820LL  阅读(1186)  评论(0编辑  收藏  举报

导航