Caused by: java.lang.NullPointerException: Location is required

将
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

你可能感兴趣的:(java)