• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

FilenameFilter problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've implemented a gif filenamefilter, but i have problem using it : here's the code:
public class GifFileFilter implements FileFilter {
public boolean accept(File f) {
return (f.getName().toLowerCase().endsWith(".gif") | | f.isDirectory());
}
}
public FileList(String Path) {
super();
File Dir = new File(Path);
String Tab[} = Dir.list(new GifFileFilter ());
}
I have a compilation error that says: "The list method called for type java.io.File with arguments (GifFileFilter) is not defined"
Should I extend the File type and define a new constructor or what?
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Med,
Look at the code below, it works good.

Regards,
Manfred.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic