NullPointerException load fxml

后端 未结 2 1929
忘掉有多难
忘掉有多难 2021-01-28 01:03

I want to load an fxml file in my application. I use the next code:

try {
   FXMLLoader loader = new FXMLLoader();
   loader.setController(null);
   loader.setRo         


        
2条回答
  •  遥遥无期
    2021-01-28 01:49

    Here is the solution.

    Add this line for the loader:

    loader.setLocation(JfxUtils.class.getResource(fxml));
    

    Very bad bug.

提交回复
热议问题