I am developing an JavaFX application. It is at its most elementary stages. But I keep getting a strange error, which i cannot manage to fix. I have looked online, and have followed the recommendations. But, the issue is so basic, that i cannot understand what could possibly be the issue. It keeps telling me that the location is required, even though the location is correct and specified.
Caused by: java.lang.NullPointerException: Location is required.
It points to the Parent root.... line for this.
Here is the code i use to load the fxml document:
public static void main(String[] args) {
launch(args);
}
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("ScheduleView.fxml"));
primaryStage.setScene(new Scene(root, 500, 500));
primaryStage.setTitle("Scheduler");
primaryStage.show();
}
Note that the above code is located in the schedule driver class.
Below is the file struture
I have tried creating a separate JavaFX project with the exact same FX code/documents, and it works. Any help would be appreciated.
Thanks.

.fxmlfile to the resources folder, there is a better solution to tell the build that such files like.fxmlmust be treated like they are in the resources folder, that can be easy done in maven, i think there should be a similar solution in gradle too. If you know both maven and gradle, I can show you the maven code then you can convert it to gradle if it is posible.