This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileFilter cannot be the superclass of ImageFilter?

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • 0
  • 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: 3340
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, it works now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic