void (StringBuilder buf, DefaultMutableTreeNode node, String lineSeparator, String indent) { buf.append(indent); final String childIndent; if (node.getParent() != null) { childIndent = indent + " "; appendNodeText(buf, node, lineSeparator); } else { childIndent = indent; } Enumeration enumeration = node.children(); while (enumeration.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode)enumeration.nextElement(); appendNode(buf, child, lineSeparator, childIndent); } }