Here you can find the source of treeStringFromTreePath(TreePath path)
public static String treeStringFromTreePath(TreePath path)
//package com.java2s; //License from project: Open Source License import javax.swing.tree.TreePath; public class Main { public static String treeStringFromTreePath(TreePath path) { StringBuilder db_path = new StringBuilder("BaseX Server"); for (int i = 1; i < path.getPathCount(); i++) { db_path.append("/").append(path.getPathComponent(i).toString()); }// w w w.j a va 2 s.c o m return db_path.toString(); } }