Search code examples
cssjavafxcolorsspinner

JavaFX Spinner - Background Color


I have looked all over the forums and haven't found anything, maybe not using the right key words. Can someone assist me in styling this outer, border-like, part of javafx spinner via css. Thanks!

javafx spinner with white border/bg color


Solution

    1. If you create a dark theme in your JavaFX application, you can use -fx-base in .root styling (in style.css) then you have all your JavaFX controls in dark:

      .root { -fx-base: rgba(60, 63, 65, 255); }

    2. If you want to change the styling only for Spinner control, you can use -fx-base for .spinner in css:

      .spinner { -fx-base: rgba(60, 63, 65, 255); }

    Other css properties of the Spinner control you can find in modena.css.