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

How to reload a jframe in java swing?

0 Answers  


Difference between AWT and Swing compenents?

3 Answers  


Why are swing components called lightweight components?

0 Answers  


What is swing and its features in java?

0 Answers  


What is the difference between swing and awt in java?

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 is java panel swing?

0 Answers  


What is the base class for all of swing components?

11 Answers   Infosys,


How to link two forms in java swing?

0 Answers  


What are the features of JFC?

1 Answers  


Which types of components are used in designing swing based gui?

0 Answers  


Categories