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!

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

odie_63
Answer

You'll have to do it in two steps in order to avoid namespace redeclarations at child level :

SQL> SELECT xmlserialize(document

  2           insertchildxml(

  3             appendChildXML(

  4               xmltype('<A xmlns="namespace" xmlns:def="myns_namespace"><B/></A>')

  5             , '/A'

  6             , xmlelement("C", xmlattributes('attribute' as "attr"))

  7             , 'xmlns="namespace"'

  8             )

  9           , '/A/C'

10           , '@def:attribute'

11           , 'def_attribute'

12           , 'xmlns="namespace" xmlns:def="myns_namespace"'

13           )

14           indent

15         )

16  FROM dual;

XMLSERIALIZE(DOCUMENTINSERTCHI

--------------------------------------------------------------------------------

<A xmlns="namespace" xmlns:def="myns_namespace">

  <B/>

  <C attr="attribute" def:attribute="def_attribute"/>

</A>

Marked as Answer by Geraud · Sep 27 2020
Geraud

Weird, I really thought I had tried this approach and it didn't work. I must not have commented out another line that I should have. This works, thank you.

1 - 2
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,834 views