Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTree Get Text of Selected Node

843805Feb 19 2007 — edited Feb 21 2007
Hi,


I've created a JTree, that adds nodes onto the "top"...
 		DefaultMutableTreeNode top = new DefaultMutableTreeNode("Users");
		jTree1 = new JTree(top);
Once I have the tree created, how do I make it get the text of the selected node.. like a JList you use the command
 jList1.getSelectedValue().toString()",
Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2007
Added on Feb 19 2007
11 comments
1,260 views