如何从 JideSoft TreeTable 中删除树线
How to remove tree lines from JideSoft TreeTable
我已经使用 TreeTable 创建了一棵树,现在我拥有了所有数据,我想删除显示在左侧的树线。
如您所见:
我希望树看起来像这样:
我尝试使用这些代码行来删除它们:
treeTable.setShowGrid(false);
treeTable.setShowHorizontalLines(false);
treeTable.setShowVerticalLines(false);
treeTable.setGridColor(Color.WHITE);
是否有一些 table 属性 我缺少可以禁用的东西?
您可以使用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").
我已经使用 TreeTable 创建了一棵树,现在我拥有了所有数据,我想删除显示在左侧的树线。 如您所见:
我希望树看起来像这样:
我尝试使用这些代码行来删除它们:
treeTable.setShowGrid(false);
treeTable.setShowHorizontalLines(false);
treeTable.setShowVerticalLines(false);
treeTable.setGridColor(Color.WHITE);
是否有一些 table 属性 我缺少可以禁用的东西?
您可以使用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").