• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

need help with jTree isNodeAncestor()

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
isNodeAncestor keeps returning false even though the value I pass in is an an ancestor node... here is what i am doing:

1. read a key from a HashMap and create a new node
2. before adding the new node (child) to the current node (node), I want to make sure that it is not an ancestor (parent or grandparent, etc..) of the current node. To do this I call:

node.isNodeAncestor(child);

But if always returns false.. my guess is that it is because the child node, even though it may be the same as an ancestor, is not the actual ancestor node.

Any idea on how I can make this work?
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic