我需要使用java swing将SB_Administrator.java中GUI左侧的虚拟文件树替换为FileTree.java的更高级的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
...................................................... ................................................... ................................................... ................................................... ................................................... ................................................... ..................
FileTree
对象File
对象(例如new File("root_path")
)作为参数给出splitPane.setLeftComponent(tree)
替换旧树splitPane.setLeftComponent(fileTree)
FileTree fileTree = new FileTree(new File("./"));
splitPane.setLeftComponent(fileTree);