code: public static TreeModelFilter containsLeafContainingStringIgnoreCase(
          final String string)
      {
          return new TreeModelFilter()
          {
              @Override
              public boolean acceptNode(TreeModel treeModel, TreeNode node)
              {
                  if (node.isLeaf())
                  {
                      if (String.valueOf(node).toLowerCase().contains(
                          string.toLowerCase())) 
                      {
                          return true;
                      }
                  }
                  for (int i=0; i<node.getChildCount(); i++)
                  {
                      if (acceptNode(treeModel, node.getChildAt(i)))
                      {
                          return true;
                      }
                  }
                  return false;
              }
  
              @Override
              public String toString()
              {
                  return "TreeModelFilter[" +
                      "containsLeafContainingStringIgnoreCase("+string+")]";
              }
          };        
      }
docs: Returns a {@link TreeModelFilter} that is accepting all leaf nodes
  whose string representation contains the given string (ignoring
  upper/lower case), and all ancestors of these nodes
  
  @param string The string that must be contained in the node string
  @return The new {@link TreeModelFilter}