I am creating a simple VBox
wrapped into a ScrollPane
.
I tried something like:
Into CSS
.scroll-bar{
visibility:hidden;
}
Into the controller:
Set<Node> nodes = scroller.lookupAll(".scroll-bar");
for (final Node node : nodes) {
if (node instanceof ScrollBar) {
ScrollBar sb = (ScrollBar) node;
sb.setVisible(false);
}
}
I tried also to style the scrollbar in other ways (also assign the class "edge-to-edge") but when the scrollbar is not needed (as default policy) I can see the space that should be occupied by the scrollbar.
My goal is to maintain the VBox
scrollable, but I want to completely hide the scrollbar.
Set the
vbarPolicy
toNEVER
.