TreePath to java.io.File

后端 未结 2 1092
执念已碎
执念已碎 2021-01-25 10:58

Is there any easy way of getting a File (or java.nio.file.Path, for that matter) from a TreePath?

For example, you have a JT

2条回答
  •  北海茫月
    2021-01-25 11:28

    I think your stuck with making your own method.

    public static String createFilePath(TreePath treePath) {
        StringBuilder sb = new StringBuilder();
        Object[] nodes = treePath.getPath();
        for(int i=0;i

提交回复
热议问题