I'm trying to setup a Java FX application with Spring Boot and AdoptOpen JDK 11.
Unfortunately I'm not able to read the FXML from the resources folder and I'm very lost because no solution I've found with Google was working in my case.
That's my application setup:
src - main - java - com.sandbox.Application
src - main - resources - primary.fxml
I tried it those way's and nothing worked (got either null or a FileNotFound exception):
Application.class.getResource("primary.fxml");
Application.class.getClassLoader().getResource("primary.fxml");
new ClassPathResource("primary.fxml", Application.class).getFile();
I also tried to make the folder structure in the resources folder the same like in the java folder so that the fxml files are under resources\com\sandbox but that's also not working.
What am I doing wrong?
Why is this so unbelievable complicated with Java?! Very annoying.