Java: Get Leaf Node Index From Leaf Nodes In A JTree

I created this method to return the index of a leaf node from its leaf nodes in the JTree object. Using the TreePaths of the root and the leaf node to search for, the method loops through all the root’s contents until it encounters the leaf node equal to the one passed to the second parameter.

Related Posts Plugin for WordPress, Blogger...

2 comments

  1. This is a good piece of content, I was wondering if I could use this piece on my website, I will link it back to your website though. If this is a problem please let me know and I will take it down right away.

Leave a Reply

Your email address will not be published. Required fields are marked *