Você está usando o defaulTreeModel, ou um model que você mesmo fez?
Normalmente problemas desse tipo acontecem quando o model esquece de disparar o evento fireTreeNodesChanged. É esse evento que “avisa” a árvore que ela deve ser atualizada.
Esse evento tem uns parâmetros meio chatos, para alterar somente uma folha, coloque os seguintes métodos no seu model e dispare-os quando você terminar de inserir o nó:
protected void fireLastPathComponentChanged(Object... path) {
fireTreeNodesChanged(this, new TreePath(path).getPath(), new int[] {},
new Object[] {});
}
protected void fireLastPathComponentInserted(Object... path) {
TreePath treePath = new TreePath(path);
Object parent = treePath.getParentPath().getLastPathComponent();
Object leaf = treePath.getLastPathComponent();
int index = getIndexOfChild(parent, leaf);
fireTreeNodesInserted(this, treePath.getParentPath().getPath(),
new int[] {index}, new Object[] {leaf});
}
protected void fireLastPathComponentRemoved(Object... path) {
TreePath treePath = new TreePath(path);
Object parent = treePath.getParentPath().getLastPathComponent();
Object leaf = treePath.getLastPathComponent();
int index = getIndexOfChild(parent, leaf);
fireTreeNodesRemoved(this, treePath.getParentPath().getPath(),
new int[] {index}, new Object[] {leaf});
}
A classe em anexo, AbstractTreeModel, contém a implementação completa de um TreeModel que usamos quando queremos implementar os nossos. É muito prática! Dê uma olhada.
Se você está utilizando o DefaultTableModel, procure um método parecido com um desses acima e dispare-o assim que você atualiza seu nó.
Para mais informações tem sempre o site da Sun:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html