是不是叶子,是由TreeModel中的isLeaf(Object o)决定的,只要正确实现即可。如:
 public boolean isLeaf(Object o){
   File dir=(File)o;
   return dir.isFile();
 }