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

前端 未结 10 1854
刺人心
刺人心 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:35

    The same problem happened to me. It's because of maven library. I have different version of jfoenix library in scene builder jfoenix:0.1.8 and in IDE jfoenix:9.0.9.so i downloaded the same version in both and it worked for me.

    And also for the nullpointer exception this code worked for me:

    FXMLLoader fxmlLoader=new FXMLLoader (Main.class.getResource ("sample.fxml"));
    Parent root =fxmlLoader.load ();
    

    The fxml file and Main is in same package.

提交回复
热议问题