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

猜你喜欢

转载自www.cnblogs.com/0820LL/p/10031938.html