import java.io.File; import javax.swing.*; import javax.swing.filechooser.*; /* ImageFilter.java is a 1.4 example used by FileChooserDemo2.java. */ /* Modified as "RawFilter" to accept only files with .raw extension */ public class RawFilter extends FileFilter { //Accept all directories and all files with extension of .raw public boolean accept(File f) { if (f.isDirectory()) { return true; } String extension = Utils.getExtension(f); if (extension != null && extension.equals( "raw" ) ) return true; else return false; } //The description of this filter public String getDescription() { return "Raw Files"; } }