Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove JavaFX TreeView Scroll Pane

I need to use a JavaFX 2.2 TreeView control inside a larger scrollpane that has several other elements which are not part of the Treeview. The problem is that TreeView has its own built-in scrollpane. Does anyone have an example of a way to turn off the built-in scrollpane so that the TreeView grows as large as the items contained within it?

like image 312
robross0606 Avatar asked Nov 10 '22 08:11

robross0606


1 Answers

While it is not currently possible to remove the scroll bars, it IS possible to mostly hide them with CSS.

.your-selector *.column-header-background *.show-hide-columns-button,
.your-selector *.scroll-bar:vertical *.increment-button,
.your-selector *.scroll-bar:vertical *.decrement-button,
.your-selector *.scroll-bar:vertical *.increment-arrow, 
.your-selector *.scroll-bar:vertical *.decrement-arrow {
    -fx-background-color: null;
    -fx-background-radius: 0;
    -fx-background-insets: 0;
    -fx-padding: 0;
    -fx-shape: null;
}

.your-selector *.scroll-bar:horizontal,
.your-selector *.scroll-bar:horizontal *.track,
.your-selector *.scroll-bar:horizontal *.track-background,
.your-selector *.scroll-bar:horizontal *.thumb,
.your-selector *.scroll-bar:horizontal *.increment-button,
.your-selector *.scroll-bar:horizontal *.decrement-button,
.your-selector *.scroll-bar:horizontal *.increment-arrow, 
.your-selector *.scroll-bar:horizontal *.decrement-arrow {
	-fx-base: transparent;
	-fx-background-color: white;
}
like image 149
robross0606 Avatar answered Nov 15 '22 06:11

robross0606