This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Consider Paul's rocket mass heater.
 
subject: FileFilter cannot be the superclass of ImageFilter?
 
Similar Threads
Cant load files into array using listFiles. I think it's an eclipse problem
Specify RGB Transparency
Question #6 from Doug's book
FileFilter--more SAME Files of Type comes out
Protected constructor in singleton pattern