1. 程式人生 > >Not on FX application thread; currentThread = AWT-EventQueue-0的解決方法

Not on FX application thread; currentThread = AWT-EventQueue-0的解決方法

swing awt跑javafx報了這問題

Not on FX application thread; currentThread = AWT-EventQueue-0

 

解決方法

Platform.runLater(new Runnable() {
        @Override
        public void run() {
          //javaFX operations should go here
        }
   });