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