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 Java Swing?

0 Answers  


What are differences between swing and awt?

0 Answers  


What is swing components in java?

0 Answers  


What is an on stage swing?

0 Answers  


what is difference between checked and unchecked exception plz explain examples ?

5 Answers   Fujitsu,






What is the use of jcomponent class in swing?

0 Answers  


What is the base class for all of swing components?

11 Answers   Infosys,


What are swing components in java?

0 Answers  


Who created the swing?

0 Answers  


How to create a swing gui in java?

0 Answers  


What is swing?

0 Answers  


Which layout does swing use by default?

0 Answers  


Categories