0

I want to achieve this: https://images.app.goo.gl/rH7o4hssPt1mLeEM9

Currently I've made a progress bar with -fx-accent: #87CEEB;

But I want it to be a linear gradient: linear-gradient(to right, #87CEEB, #2980b9);

How can I make it?

Lazar Ljubenović
  • 18,976
  • 10
  • 56
  • 91

1 Answers1

6

You just have to use CSS to select the bar of the progress-bar:

.progress-bar .bar {
    -fx-background-color: linear-gradient(to right, #87CEEB, #2980b9);
}

Then just add your stylesheet to your scene:

scene.getStylesheets().add("Style.css");

screenshot

Zephyr
  • 9,885
  • 4
  • 28
  • 63