给你个展开全部树节点的方法:
class MyTree extends JTree{ public void expandAll() { int row = 0; while (row < getRowCount()) { this.expandRow(row); row++; }}}