aspose file tools*
The moose likes Beginning Java and the fly likes FileFilter cannot be the superclass of ImageFilter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "FileFilter cannot be the superclass of ImageFilter?" Watch "FileFilter cannot be the superclass of ImageFilter?" New topic
Author

FileFilter cannot be the superclass of ImageFilter?

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

why do I get this

The type FileFilter cannot be the superclass of ImageFilter; a superclass must be a class


Jesus lives
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
There are 2 FileFilter definitions, java.io.FileFilter is an interface, your class ImageFilter must implement FileFilter in the way your are using it.

Now, if you are using the JFileChooser, the setFileFilter method takes the other class javax.swing.filechooser.FileFilter which is an abstract class that does not implement java.io.FileFilter (Why it doesn't is beyound me) if you wish to use that, simply change your import statement and extends is fine.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

thanks, it works now
 
 
subject: FileFilter cannot be the superclass of ImageFilter?