springboot-javafx-support icon indicating copy to clipboard operation
springboot-javafx-support copied to clipboard

Location not set if the view in a different package from the App class.

Open asifmohammed opened this issue 6 years ago • 4 comments

I keep gettingjava.lang.IllegalStateException: Location is not set. If I have my view in a different package from the App class

asifmohammed avatar Feb 08 '18 22:02 asifmohammed

Im getting the same issue

usaaama2010 avatar Feb 16 '18 11:02 usaaama2010

I had the same issue. The view has to be in the same package as the .fxml-file. The controller can be in a different package however. It is also important that the .fxml-files uses lowercase names. See this structure and naming:

screenshot at 2018-03-10 13-00-42

I mostly use the view-classes as a marker for the location of the .fxml-file. It doesn't contain more than the @FXMLView-annotation and a bundle. It is the controller-class that holds all logic.

@FXMLView(bundle="org.daaksord.kiosk.ui.i18n.cart", encoding = "UTF-8")
public final class CartView extends AbstractFxmlView {}

And to switch view:

MainApp.showView(CartView.class);

Pyknic avatar Mar 10 '18 12:03 Pyknic

Something seems to be broken... Should behave in different way. Will verify this...

roskenet avatar Mar 12 '18 09:03 roskenet

Same issue !! @Pyknic structure and naming worked for me, thanks 👍

mtbadi39 avatar Apr 14 '18 21:04 mtbadi39