JavaFx: TreeView
How can I make such stripes (hatching) in TreeView?
I Googled as much as I could, there is no hint of such a thing anywhere
5
Author: Anton Shchyrov, 2018-02-27
1 answers
Very simple:
TreeItem<HBox> item=new TreeItem<HBox>(new HBox(new ImageView(new Image(inputStream)),new Label("Root")));
item.getChildren().add(new TreeItem<HBox>(new HBox(new ImageView(new Image(inputStream)),new Label("Item1"))));
TreeView<HBox> treeView=new TreeView<HBox>(item);
If desired, you can make a class instead of HBox, which will automatically change the image depending on the structure of the TreeItem.
2
Author: Александр, 2018-07-21 16:32:25