I have a custom JTree and a custom JModel; I would for the JTree to \"auto-expand\" when I give it a new model. At the moment, it simply collapse a
JTree
JModel
There's also this non-recursive version.
private void expandAllNodes(JTree tree) { int j = tree.getRowCount(); int i = 0; while(i < j) { tree.expandRow(i); i += 1; j = tree.getRowCount(); } }