Issue
I am trying to change the style of the javafx spinner using a css stylesheet.
I know I can change the spinner button orientation via this code:
Spinner<Integer> spinner = new Spinner<Integer>(1, 20, 10);
spinner.getStyleClass().add(split-arrows-horizontal);
root.getChildren().add(spinner);
However, I want to achieve this via CSS or FXML. Does anybody know the solution
Solution
You can easily create a Spinner
like this using fxml:
<Spinner styleClass="split-arrows-horizontal">
<valueFactory>
<SpinnerValueFactory.IntegerSpinnerValueFactory min="1" max="20" initialValue="10" />
</valueFactory>
</Spinner>
You could of course copy all the styles from modena.css
containing .split-arrows-horizontal
as part of it's selector and use all of them, even if this part of the selector does not apply, but this seems unnecessarily complicated compared with the approach posted above.
Answered By - fabian
Answer Checked By - Gilberto Lyons (JavaFixing Admin)