dcsimg

How can I refresh a JTree when its contents change?

Sandip Chitale

If your tree model is a subclass of

javax.swing.tree.DefaultTreeModel

it is just a matter of calling

((DefaultTreeModel)yourTree.getModel()).reload();