1. /*
  2. * @(#)FileFilter.java 1.14 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.filechooser;
  11. import java.io.File;
  12. /**
  13. * FileFilter is an abstract class that has no default implemention.
  14. * A FileFilter, once implemented, can be set on a JFileChooser to
  15. * keep unwanted files from appearing in the directory listing.
  16. * For an example implementation of a simple file filter, see
  17. * <code><i>yourSDK</i>/demo/jfc/FileChooserDemo/ExampleFileFilter.java</code>.
  18. * For more information and examples see
  19. * <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html">How to Use File Choosers</a>,
  20. * a section in <em>The Java Tutorial</em>.
  21. *
  22. * @see javax.swing.JFileChooser#setFileFilter
  23. * @see javax.swing.JFileChooser#addChoosableFileFilter
  24. *
  25. * @version 1.14 02/02/00
  26. * @author Jeff Dinkins
  27. */
  28. public abstract class FileFilter {
  29. /**
  30. * Whether the given file is accepted by this filter.
  31. */
  32. public abstract boolean accept(File f);
  33. /**
  34. * The description of this filter. For example: "JPG and GIF Images"
  35. * @see FileView#getName
  36. */
  37. public abstract String getDescription();
  38. }