I'm having a problem with JavaFX FMXL loading files in my project and also started to learn IntelliJ. So, I've imported a simple, SceneBuilder project from my GitHub to IntelliJ, but when I start to run the application, I got the "location is not set" exception. In the screenshot below I'm showing the code and my project path:
Here's the error code:
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at mouseClicker.SwitchScene.moveToMainWindow(SwitchScene.java:28)
at mouseClicker.App.start(App.java:16)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
However, the exacly same code works for me in Eclipse, which I also have just installed on this computer:
How is this possible? Does this mean that my code isn't somehow portable to other IDEs or even worse, will not work at all at some environmental circumstances and if yes, what is the good practice to avoid such situations in the future?