Treeview - Jtree (Netbeans) Adding a description to a selected node

Asked

Viewed 155 times

2

I am doing a simple treeview in Netbeans and would like to know how to add a description to a selected node by means of a button that has a function that will associate to a lable.

treeview

o que eu quero implementar

the code for the ">>" button that will insert the description is like this:

private void add2ActionPerformed(java.awt.event.ActionEvent evt) {                                     
   lTree2.setText(tf2.getText());
} 

obviously does not do what I intend, just put to illustrate what I want to know.

  • I don’t quite understand your question. Do you want to replace aaa with bbb? You have a model taking care of your Jtree’s items?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.