FileDocCategorySizeDatePackage
ExtensionFilter.javaAPI DocExample755Tue Feb 14 13:39:32 GMT 2006com.elharo.swing.filechooser

ExtensionFilter

public class ExtensionFilter extends FileFilter

Fields Summary
private String
extension
private String
description
Constructors Summary
public ExtensionFilter(String extension, String description)


    if (extension.indexOf('.") == -1) {
      extension = "." + extension;
    }
    this.extension = extension;
    this.description = description;
  
Methods Summary
public booleanaccept(java.io.File f)

  
    if (f.getName().endsWith(extension)) {
      return true;
    }
    else if (f.isDirectory()) { 
      return true;
    }
    return false;
  
public java.lang.StringgetDescription()

    return this.description + "(*" + extension + ")";