My JavaFX programme must be able to locate FXML files, as well as stylesheets (CSS files) and images, in order to load them with the FXMLLoader. When I try to load these, I frequently receive errors or the item I'm trying to load doesn't load at all.
The error message I see for FXML files includes the following:
Caused by: java.lang.NullPointerException: location is not set
For images, the stack trace includes
Caused by: java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
What is the best way for me to determine the correct resource path for these resources?