Swingworker with FileVisitor class and walkFileTree(), which iterates internally over a “set” of files in a directory tree; where to publish()?
问题 It seems like the long-running tree walker task should be defined in a class like so: public class TreeWalker extends SwingWorker<Void,String> implements FileVisitor<Path> And begun somewhere like so: TreeWalker walker = (new TreeWalker()); walker.execute(); The long-running task is not only initiated by but completely carried out by a single call to walkFileTree() , a method in the Files class. So surely the call to it has to be in doInBackGround() . protected Void doInBackground() throws