I have a JavaFX program that uses Maven, with a standard maven file tree:
How do I reference logo.png from within layout.fxml, assuming that layout is being inflated by a call to
Parent root = FXMLLoader.load(getClass().getResource("/fxml/layout.fxml"));
in MainApp
.
I've trying to do so using
<image>
<Image url="@/graphics/logo.png" />
</image>
and have tried many variations on that file path (with and without the @
), but keep throwing a
java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.IllegalArgumentException: URL must not be empty
on the line where the URL is created