JavaFX and maven: NullPointerException: Location is required

后端 未结 6 1973
别跟我提以往
别跟我提以往 2020-11-28 07:03

I have been trying to get Maven set up with JavaFX. Even though I was unexperienced with Maven and JavaFX, I didn\'t expect it to be so much of a challenge. My Java knowledg

6条回答
  •  悲哀的现实
    2020-11-28 07:26

    I had the same issue with Intelij and Gradle.

    Steps to fix:

    1.Move file

    sample.fxml

    to path

    \src\main\resources\fxml

    1. Set path on this file:

    Parent root = FXMLLoader.load(getClass().getResource("/fxml/sample.fxml"));

提交回复
热议问题