Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

Processing
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,805 views