I'm trying to load a .fxml file from some package and can't manage to do it.
Here is my file tree :
And here's the viewService which tries to return an FXML loader set to my fxml file :
private static FXMLLoader getLoader(String id) {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(App.class.getResource("/" + id + ".fxml"));
loader.load();
return loader;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
I've read everywhere that i needed to kind of reproduce the tree of my package in my resources folder but i can't manage to do it correctly : Everytime i try, i'm getting something like this and it doesn't work :
I am getting mad on this, please help me !