code: public static List<TreePath> computeExpandedPaths(JTree tree)
      {
          List<TreePath> treePaths = new ArrayList<TreePath>();
          int rows = tree.getRowCount();
          for (int i = 0; i < rows; i++)
          {
              TreePath treePath = tree.getPathForRow(i);
              treePaths.add(treePath);
          }
          return treePaths;
      }
docs: Compute the list of all tree paths in the given tree that are currently
  expanded
  
  @param tree The tree
  @return The expanded paths