B4J Question Scrollpane Scroll bar Color

Discussion in 'B4J Questions' started by MarcTG, May 30, 2019.

  1. MarcTG

    MarcTG Active Member Licensed User

    I am trying to change the color of the vertical and horizontal scrollbars in a scrollpane using Extra CSS but it doesn't seem to be working... Can anyone please suggest how this can be done?

  2. AnandGupta

    AnandGupta Active Member Licensed User

    Just upload the code which is not working and we may find the solution.


  3. MarcTG

    MarcTG Active Member Licensed User

    .scroll-pane {
        -fx-background-color: orange;

    .scroll-bar:horizontal, .scroll-bar:vertical{

    .increment-button, .decrement-button {
        -fx-background-color: transparent;
        -fx-border-color: transparent;

    .scroll-bar:horizontal .track,
    .scroll-bar:vertical .track{
        -fx-background-color: blue;
        -fx-border-color: blue;
        -fx-background-radius: 0em;

    .scroll-bar:horizontal .thumb,
    .scroll-bar:vertical .thumb {
        -fx-background-color: white;
        -fx-background-radius: 5em;
    Not sure how to do it using the Extra CSS...
  4. Erel

    Erel Administrator Staff Member Licensed User

    You cannot. You must use a CSS file for this. It is very simple: CSS Example
  5. MarcTG

    MarcTG Active Member Licensed User

    Thanks Erel.

    I made it work using that example
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice