Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FilenameFilter problem

 
med lam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Med,
Look at the code below, it works good.

Regards,
Manfred.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!