2017-11-27 8 views
1

はJDK 9によって引き起こさスタイルシート(JDK 9)

<stylesheets> 
    <URL value="@MainView.css" /> 
</stylesheets> 

へのアップデート後に動作しません。 。

私を助けることができますか?

+0

https://stackoverflow.com/questions/23475727/how-to-attach-a-css-stylesheet-to-fxmlを参照してください。 –

+0

[CSSスタイルシートをFXMLに添付する方法](https:///stackoverflow.com/questions/23475727/how-to-attach-a-css-stylesheet-to-fxml) –

答えて

0

それは、ルートレベルの属性として私の作品、ここに私のIndex.fxmlは例として次のとおりです。

<?xml version="1.0" encoding="UTF-8"?> 
<?import javafx.scene.layout.*?> 
<?import javafx.scene.control.*?> 
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" styleClass="app" stylesheets="@Index.css" 
    fx:controller="fr.pdem.view.IndexController" fx:id="root"> 
    <!-- all the nodes--> 

</AnchorPane> 

私の戦略は、FXMLごとにCSSファイルを使用することですので、私は必要はありませんファイルをリストします。

サイドノート:インポートにワイルドカードを使用することをお勧めしますが、例の場合は機能します。

関連する問題