I create a Jtree that all of its nodes have User object, I fill user object by ItemInfo class, now my problem is with renaming a node. I can edit my node but since I try to find my UserObject I saw when I press F2 and rename my node, new name place in my UserObject!
So now I want to know I should touch where to replace new name of my node with previous name manually?
I guess I need to write my own DefaultTreeCellRenderer class, please advice me... (if yes any example for my reference)
public class ItemInfo {
public String Name;
public String Value;
public long ValueID;
public ItemInfo(String Name, String Value) {
this.Name = Name;
this.Value = Value;
}
public ItemInfo(String Name, long ValueID) {
this.Name = Name;
this.ValueID = ValueID;
}
public String toString() {
return Name;
}
public String getValue() {
return Value;
}
public long getValueID() {
return ValueID;
}
}