Considered the attached sample. I have misspelled "title-pane.fxml" into "titled-pane.fxml".
When running the sample, we get this stack:
Feb 21, 2012 9:07:00 PM loadfxml.Main start
SEVERE: null
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:1891)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2484)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2476)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2470)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2464)
at loadfxml.Main.start(Main.java:37)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:315)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:174)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141)
Something saying "File Not Found" might have been more appropriate.
Hmmm... now that I think on it maybe getResource() was returning null, which would explain the "Location is not set" message.
In that case maybe the best would be for the FXMLLoader.load(...) method to throw a NullPointerException when its first argument is null?
When running the sample, we get this stack:
Feb 21, 2012 9:07:00 PM loadfxml.Main start
SEVERE: null
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:1891)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2484)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2476)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2470)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2464)
at loadfxml.Main.start(Main.java:37)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:315)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:174)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141)
Something saying "File Not Found" might have been more appropriate.
Hmmm... now that I think on it maybe getResource() was returning null, which would explain the "Location is not set" message.
In that case maybe the best would be for the FXMLLoader.load(...) method to throw a NullPointerException when its first argument is null?