Exception in Application start method java.lang.reflect.InvocationTargetException

前端 未结 10 1763
刺人心
刺人心 2021-01-02 18:47

I am just starting out with JavaFX, and I am trying to build a simple application with a label, text field and button which, when clicked, sets the label\'s value to that of

10条回答
  •  抹茶落季
    2021-01-02 19:31

    I've been looking through this thread and the answers but the cases are a bit different for me

    the code written in the main file is not as mentioned like this:

    FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindowView.fxml"));
    

    the code in my case is like this:

    FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
    

    and I encountered the same error(approx.)

提交回复
热议问题