JavaFX Hide ScrollPane gray border


Question

Is there any way of hiding the gray border of an ScrollPane control in JavaFX ?

1
20
10/15/2012 4:21:13 PM

Accepted Answer

All controls in JavaFX can be modified using CSS styling. You may want to take a look at reference or tutorial.

Gray ScrollPane's border is actually the only part of the background which is visible behind the content. So you can change it by modifying the background:

    ScrollPane sp = new ScrollPane();
    sp.setStyle("-fx-background-color:transparent;");
34
10/15/2012 5:23:36 PM

Or in CSS

.scroll-pane {
    -fx-background-color:transparent;
}

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon