How to hide ListView horizontal scrollbar in JavaFX

Can a cow hide a horizontal scrollbar ListView? I tried it differently and it may be completely easy, but I just can't get it to work.

+5
source share
3 answers

Try this in CSS:

.list-view .scroll-bar:horizontal .increment-arrow,
.list-view .scroll-bar:horizontal .decrement-arrow,
.list-view .scroll-bar:horizontal .increment-button,
.list-view .scroll-bar:horizontal .decrement-button {
    -fx-padding:0;
}
+27
source

I think it would be better to ListCell with a panel (e.g. StackPane) and a shortcut inside that would have an ellipsis function:

StackPane pane = new StackPane();
pane.setStyle("-fx-border-color:red;");
pane.setMinWidth(0);
pane.setPrefWidth(1);
pane.getChildren().add(label);

You can look at this link .

The same solution can be used for another ListCells complex.

0
source

, . CSS:

.list-view .scroll-bar:horizontal {
    -fx-opacity: 0;
    -fx-padding:-7;
}

, , , , .

-1
source

All Articles