I am trying to load an XML Resource, and I am doing it like this:
fxmlLoader = new FXMLLoader();
root = fxmlLoader.load(getClass().getResource("Document.fxml").openStream());
When I run my code I then get this error:
null/../css/button.css
javafx.fxml.LoadException:
unknown path:23
When I look at line 23 I have this:
<URL value="@../css/button.css" />
this works:
fxmlLoader = new FXMLLoader();
root = fxmlLoader.load(getClass().getResource("Document.fxml"));
but then when I run the following
controller = (DocumentController)fxmlLoader.getController();
controller is null
How can I fix the css issue?
fx:controllerdefined in yourDocument.fxml?<AnchorPane fx:id="anchorPane" minHeight="200.0" minWidth="200.0" prefHeight="600.0" prefWidth="1200.0" styleClass="anchor-pane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="phantom.DocumentController">