FileDocCategorySizeDatePackage
JavaFilter.javaAPI DocExample473Sun Mar 28 19:08:38 BST 1999com.macfaq.swing.filechooser

JavaFilter.java

package com.macfaq.swing.filechooser;

import javax.swing.filechooser.*;
import java.io.*;

public class JavaFilter extends javax.swing.filechooser.FileFilter {

  public boolean accept(File f) {
    if (f.getName().endsWith(".java")) return true;
    else if (f.getName().endsWith(".jav")) return true;
    else if (f.isDirectory()) return true;
    return false;
  }
  
  public String getDescription() {
    return "Java source code (*.java)";
  }

}