I have created a JTree without any node. The tree is blank. The user has say create node then comes a dialog where the user has to enter the number and when he says ok then this number should be created as a node there. And since the tree is empty i am getting is a create icon which i want it to be removed.
So what i need is
1) Node should be created at usercommand
2) When the empty tree is created then the icon created should be removed the tree should be blank when i start my gui.
My code is as follows.
DefaultMutableTreeNode node = new DefaultMutableTreeNode("");
DefaultTreeModel tModel = new DefaultTreeModel(node);
JTree tree = new Jtree(tModel);
So this code creates an empty JTree with a create icon as the root element which should be removed
and when the user presses the ok button of the dialog the value in the dialog box should be used to create a tree.
Thanks in advance