JavaFX getResource() returns null

39 Views Asked by At

I am using netbeans to create a JavaFX application, using scenebuilder.

My program is able to compile, but when I run I get null pointer exception error.

I've narrowed the problem down to the getResource() function returning null, and I have looked at other solutions, but they do not fix my problem.

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

I have tried giving the absolute file path, as well at the local path, and as you can see the relative path. I have also checked other files as a test, but whatever I pass returns null.

This is my src folder: src image

0

There are 0 best solutions below