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 are the advantage of swing over awt?

0 Answers  


What is swing control?

0 Answers  


Hello Everyone.. I m trying to develop a java swing application where i can display a doc file Jeditorpane or Jtextpane.

0 Answers  


What are the components of swing?

0 Answers  


What is the function of lightweight components used in swing?

0 Answers  






What is swing container?

0 Answers  


What are controls and what are different types of controls in awt?

0 Answers  


How to print in java swing application?

0 Answers  


What are the benefits of using Swing over AWT?

5 Answers  


Is swing better than awt?

0 Answers  


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

0 Answers  


What is Java Swing?

0 Answers  


Categories