我需要帮助使用java swing替换虚拟文件树在图形用户界面左侧的SB_Administrator.java到更高级的java树的FileTree.java。
我目前正在使用Eclipse中的windowBuilder。
提前感谢您的帮助
SB_Administrator.java
// Get the root node of the tree
DefaultMutableTreeNode rootSess = (DefaultMutableTreeNode) tree.getModel().getRoot();
//rootSess.setUserObject(sess); // remember the Session in it
splitPane.setLeftComponent(tree);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
splitPane.setRightComponent(tabbedPane);
}
}
FileTree.java
............................................................................................................................................................................................................................................................................................................................
发布于 2020-01-23 21:31:47
FileTree
对象File
对象作为参数(e.q.使用新的树splitPane.setLeftComponent(fileTree)
new File("root_path")
)
splitPane.setLeftComponent(tree)
FileTree fileTree = new FileTree(new File("./"));
splitPane.setLeftComponent(fileTree);
https://stackoverflow.com/questions/59887220
复制相似问题