Class FileTree

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class FileTree extends JTree
Creates a javax swing JTree object which represents the structure of a given sub-tree in a file system. The nodes in the tree represent the directories and non-directory files, and are labeled with their local names.
See Also:
  • Constructor Details

    • FileTree

      protected FileTree(TreeNode node)
  • Method Details

    • make

      public static FileTree make(File f)
      Creates a FileTree representing the file system structure.
      Parameters:
      f - the point in the file system where the displayed tree starts. ATTENTION: must be a directory!
    • main

      public static void main(String[] args)
      A demonstration: create a FileTree starting at the given point and make it visible on the default screen.
      Parameters:
      args - args[0] is the path to the directory the contents of which will fill the JTree.