Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileFilter cannot be the superclass of ImageFilter?

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why do I get this

The type FileFilter cannot be the superclass of ImageFilter; a superclass must be a class
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, it works now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic