Setting JavaFX TreeView Line Style

2019-07-04 05:51发布

In Java Swing, there is JTree.linestyle property that enables/disables lines connecting the parent nodes in a tree to their children. Is there something similar in JavaFX 2? In all of the TreeView examples I've looked at for JavaFX, I haven't seen this. I also didn't see a CSS property to set.

标签: javafx-2
1条回答
The star\"
2楼-- · 2019-07-04 06:06

JavaFX 2.2 does not have such a setting out of the box. A feature request could be filed in the JavaFX issue tracker.

You may be able to achieve the line connection effect by creating custom TreeCell and TreeItem nodes and, on those, setting the treeCell.disclosureNodeProperty and the TreeItem graphicProperty as appropriate based upon the various settable event handlers for the TreeItem.

查看更多
登录 后发表回答