Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree last selected path component is giving null

 
Nageswar Kakolla
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am trying to access determine selected node in JTree to delete tree node and i am using

JTree tree = new JTree();

tree.getLastSelectedPathComponent() is seleted node but somehow this is giving null value and i checked tree.getMaxRowCount is 1 meaning i have only two levels in Tree.
Root node and rest of them are childrens

Does anybody throw somelight on this ?

Root
|--child1
|-- child2
|-- child3

etc
above is my tree structure.
i know the logic for deleting of tree node based on selected node

Thanx for help
 
Sam Codean
Ranch Hand
Posts: 194
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you send me the code snippet. I may be able to help.
Could you also elaborate as to what are you trying to do?
JTree tree = new JTree(); would create only a sample tree and not the kind you require, hope you are not doing something wrong there
[ March 08, 2006: Message edited by: Sam Codean ]
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems to work okay. Maybe you can modify it to demonstrate the null values.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic