A TreeModelcan have only one root root, but you can use JTree.setRootVisible()to hide the root root when displaying the tree. Change the model to have a virtual root node that contains each root of the file system (C: \, D: \, E: \ etc.) and calls JTree.setRootVisible(false)on your JTree.
source
share