position of a node

Posted on 2006-04-26
Last Modified: 2010-03-31

hello there,

is it possible to get the depth of the tree nodes.for example i want to get xxx as root,yyy as 1 and zzz as short i need to get the position of a node.

JTree                         JTabbedPane
-xxx                           xxx     yyy    zzz

Question by:zolf
    LVL 86

    Accepted Solution

    Try getPathCount of the TreePath(s) selected
    LVL 30

    Assisted Solution

    Maybe treeNode.getPathForRow ().getPath ().length ;
    LVL 86

    Expert Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now