Get the treenode index of objects of THE SAME LEVEL

S

Spendius

Hi,
Say we have the following JTree:
+ root
+-- obj1
| |-- obj11
| +-- obj12
+-- obj2
| +-- obj21
+-- obj3
|-- obj31
+-- obj32

If I click on 'obj2' I'd like to get the value 2 because
'obj2' is the 2nd node to appear in this level, if I
click on 'obj3' I'd like to get 3 (i.e. I'd like to the
index of this object but with a count in relationship with
the objects of *the same level* only).
Has someone an idea of how I could perform this ?
Thanks a lot !
Regards,
Spendius
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top