I have done as follows. But I am getting ClassCastException in the return statement.Even I tried with JTextField also. I am getting the same exception
In the NonRootEditor class I have written as follows:
Does anyone have idea on how to make some specific nodes in JTree as non editable.
My tree structure is as follows:
where I want the nodes Root 1, Root2....Root n to be non editable.
But the Parent nodes and child nodes to be editable.
The tree has popup which has options for renaming these nodes.
So I have set as follows
How to make nodes Root 1, Root2....Root n to be non editable?
Where I get popup on right click of the node with options Add, Remove & Rename. So I can rename the node. The node name’s length should be <=16 characters. So while renaming the node, I want to stop the keystrokes if it reach 16 characters.
I have written the follwing code and garbage collection is happening properly and memory leakage problem is almost solved.
panel.removelAll(); //(panel is nothing but a JPanel) which removes all the components from the container and dispatches all the events also
panel = null; //After removing all from the panel and making it null ensures the panel to be garbage collected.