A board discussion about browsing a tree to find a particular node. The solution of Sandeep Deb seems to be good with recursivity, but have to be adapted to work. Good basis though.
Question on Stack Overflow about how to get all items of a JTree. Look for kleopatra's answer for best practice.