How to add and delete nodes in Jtree?

Answer Posted / ramachandran

Iam try this code but not properly working...yor try to get
ans and post..........




DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
DefaultMutableTreeNode root =
(DefaultMutableTreeNode)model.getRoot();
root.add(new DefaultMutableTreeNode("another_child"));
model.reload(root);..........

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java swing package?

513


What are the two key features of swing?

534


How does accessibility works in swings?

555


What is the difference between invokeAndWait() and invokeLater()?

595


What is swing delegation event model in java?

554






How to generate bill in java swing?

684


What is swing in java javatpoint?

534


What is the design pattern that java uses for all swing components ?

509


What are swing components?

597


What are the features of swing in java?

513


What is the purpose of action interface in swing?

562


Why is model-view-controller architecture used in swing?

547


What are the components of swing in java?

545


What is the what is the difference between invokeandwait() and invokelater()? ?

633


What is java swing gui?

472