tags:

views:

40

answers:

1

I have a JTree like this:

MasterRoot
+-RootA
 +-ChildA1
  +-GrandChildA1a
+-RootB
 +-ChildB1
  +-GrandChildB1a

I don't want the MasterRoot node to be displayed But if I call `configTree.setRootVisible(false);

I got:

RootA
 +-ChildA1
  +-GrandChildA1a
RootB
 +-ChildB1
  +-GrandChildB1a

And I want this:

+-RootA
 +-ChildA1
  +-GrandChildA1a
+-RootB
 +-ChildB1
  +-GrandChildB1a

Note: yes I just need the '+-' (what the name for that ? Node Handler ??) to be displayed to my first level nodes after the master root.

+2  A: 

The '+-' is called a 'handle' and the method you need to call is setShowsRootHandles(true).

This is really just a hint to the UI. It's left up to the look and feel whether to honor the hint.

Devon_C_Miller
Thanks a lot and all my apologies for being so late in accepting your answer.
Guillaume