Here you can find the source of logTreeNodes(TreeModel model, Object node, String indent)
private static void logTreeNodes(TreeModel model, Object node, String indent)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.text.SimpleDateFormat; import java.util.Date; import javax.swing.tree.TreeModel; public class Main { static final SimpleDateFormat _DateFormatter = new SimpleDateFormat("HH:mm:ss:SSS"); private static void logTreeNodes(TreeModel model, Object node, String indent) { logToConsole(indent + node.toString()); for (int i = 0; i < model.getChildCount(node); i++) logTreeNodes(model, model.getChild(node, i), "| " + indent); }/*from www.j a va 2 s. co m*/ /** * writes a text message prefixed with the current time to the console */ static void logToConsole(String msg) { System.out.println(_DateFormatter.format(new Date()) + " IBController: " + msg); } }