1
設置我使用GraniteDS的+的JavaFX +彈簧小測試項目。我遵循這個教程GraniteDs+JavaFx。GraniteDS的基本位置不TideFXMLLoader
所有工作正常,但如果我使用一個FXML文件中,我有一個相對URL一些圖片如下例所示:
<children>
<ImageView fitHeight="32.0" fitWidth="32.0" layoutX="14.0" layoutY="14.0" onMouseClicked="#menuHome" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../images/icons/home.png" />
</image>
</ImageView>
我有這個execption:
SEVERE: Could not show view
javafx.fxml.LoadException: Base location is undefined.
at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:283)
at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:197)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:570)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2314)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2131)
at org.granite.client.tide.javafx.TideFXMLLoader.load(TideFXMLLoader.java:49)
代碼加載FXML是這樣的:
有一種方法來設置TideFXMLLoader的基本位置?
感謝