Java tutorial
//package com.java2s; import javax.swing.JTree; public class Main { public static void expandAllNodes(JTree tree) { int row = 0; while (row < tree.getRowCount()) { tree.expandRow(row); ++row; } } }