How to add and delete nodes in Jtree?



How to add and delete nodes in Jtree?..

Answer / 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

More Swing Interview Questions

What is swing container?

0 Answers  


Which method is used for setting security in applets?

0 Answers  


What is an event and what are the models available for event handling?

0 Answers  


What is swing control in java?

0 Answers  


What are the benefits of swing over awt?

0 Answers  


Is swing thread-safe?

0 Answers  


Why are swings considered lightweight?

0 Answers  


What are the various components of swing?

0 Answers  


What are heavy weight components ?

0 Answers  


Which window contains the swing controls?

0 Answers  


What is an event in Swing?

0 Answers  


Is swing better than awt?

0 Answers  


Categories