I created a form with default NetBeans edito and put a jTree
on it.
It somehow then creates bunch of elements such as \"colors\", \"sports\", \"food\" in there.
Problem in next you create your JTree
like this JTree tree = new JTree()
(according to docs) it has sample nodes. Add next lines after you create your nodes(root,child1,child2) and all will be work:
DefaultTreeModel model =(DefaultTreeModel) jTree1.getModel();
model.setRoot(root);
Also you needn't to call jTree1.removeAll();
it is used for other purposes.(docs)
Read tutorial for JTree