Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Hide horizontal and vertical lines in a JTree

843806Oct 23 2007 — edited Oct 24 2007
Hi,

suppose we have three JTrees in a Windows L&F where the second one shall not show any vertical or horizontal lines for a node. If this restriction would be true for all three JTrees one could invoke
UIManager.put("Tree.paintLines", Boolean.FALSE)
.

However only the second one must not show any lines. I tried something like
tree.putClientProperty("Tree.paintLines", Boolean.FALSE);
tree.updateUI();
But unfortunately this does not work as the lines are still shown. Furthermore we need to set "on/off" the lines dynamically dependend on the user data.

Does anyone have a clue to solve this problem?

Thx.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2007
Added on Oct 23 2007
5 comments
2,567 views