I have to add a child new node on right click of a parent node to JTree. The JTree should work same as tree works while we explore things in myComputer.
Please tell me if it is possible or not? If yes then please help me to do this...
It works if you use a DefaultTreeModel, with TreeNodes.
Upon right clicking (use a MouseListener and its isPopupTrigger method), you create a new TreeNode (usually DefaultMutableTreeNode), retrieve the model from the JTree, and call its insertNodeInto method: