Can anyone help me with using CSS in JavaFx? I'm encountering an error while trying to add a CSS file (style.css) to my fxml file through stylesheets. The error message I'm getting is:
com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged WARNING: Resource "@style.css" not found.
Below is the code snippet from my FXML file:
<GridPane fx:controller="sample.Controller"
xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"
stylesheets="@style.css">
<Button text="Button One" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
<Button text="Button Two" GridPane.rowIndex="0" GridPane.columnIndex="2"/>
<Button text="Button Three" GridPane.rowIndex="0" GridPane.columnIndex="3"/>
<Button text="Button Four" GridPane.rowIndex="0" GridPane.columnIndex="4"/>
<Button text="Button Five" GridPane.rowIndex="0" GridPane.columnIndex="5"/>
</GridPane>
I'm not sure if I need to specify a path or include a jar file somewhere. Any assistance in resolving this issue and helping me continue my learning would be greatly appreciated. Thank you for your support!