Caused by: java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3207)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
at cypher.choose.ChooseController.encrypt(ChooseController.java:30)
... 58 more
我从控制器中的代码得到此错误:
@FXML
public void encrypt(ActionEvent event) throws IOException{
Stage primaryStage = (Stage)((Node)event.getSource()).getScene().getWindow();
Parent encrypt = FXMLLoader.load(getClass().getResource("cypher/encrypt/encrypt.fxml"));
Scene encryptScene = new Scene(encrypt,800,500);
primaryStage.setScene(encryptScene);
}
我确定有人问过类似的问题,但我已经找了一段时间,找不到答案