将 Parent root = FXMLLoader.load(getClass().getResource("xml/MainUI.fxml")); 改为: Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("xml/MainUI.fxml"));
将 Parent root = FXMLLoader.load(getClass().getResource("xml/MainUI.fxml")); 改为: Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("xml/MainUI.fxml"));
转载于:https://www.cnblogs.com/xiaojf/p/11060023.html