Setting JavaFX TreeView Line Style

别说谁变了你拦得住时间么 提交于 2020-01-04 04:55:11

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/13768483/setting-javafx-treeview-line-style

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!