gpt4 book ai didi

java - 如何从JideSoft TreeTable中删除树线

转载 作者:行者123 更新时间:2023-12-02 12:16:44 25 4
gpt4 key购买 nike

我已经使用 TreeTable 创建了一棵树,现在我已经拥有了所有数据,我想删除左侧显示的树线。正如您在这里看到的:

enter image description here

我希望树看起来像这样:

enter image description here

我尝试使用这些代码行来删除它们:

treeTable.setShowGrid(false);
treeTable.setShowHorizontalLines(false);
treeTable.setShowVerticalLines(false);
treeTable.setGridColor(Color.WHITE);

我是否缺少一些可以禁用的表属性?

最佳答案

您可以使用TreeTable.setShowTreeLines()方法:

We used the same +/- icons used in JTree so it will change based on different LookAndFeels. You can also define your own icons by calling CategorizedTable.setExpandedIcon(javax.swing.Icon) and CategorizedTable.setCollapsedIcon(javax.swing.Icon). The tree lines can be turn on or off using setShowTreeLines(boolean). The line color can be set by setTreeLineColor(java.awt.Color). By default, it will use the JTree's tree line color which is UIManagerLookup.getColor("Tree.hash").

关于java - 如何从JideSoft TreeTable中删除树线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46114882/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com