KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > filechooser > FileFilter


1 /*
2  * @(#)FileFilter.java 1.19 04/06/28
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.filechooser;
9
10 import java.io.File JavaDoc;
11
12 /**
13  * <code>FileFilter</code> is an abstract class that has no default
14  * implementation. A <code>FileFilter</code>, once implemented,
15  * can be set on a <code>JFileChooser</code> to
16  * keep unwanted files from appearing in the directory listing.
17  * For an example implementation of a simple file filter, see
18  * <code><i>yourJDK</i>/demo/jfc/FileChooserDemo/ExampleFileFilter.java</code>.
19  * For more information and examples see
20  * <a HREF="http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html">How to Use File Choosers</a>,
21  * a section in <em>The Java Tutorial</em>.
22  *
23  * @see javax.swing.JFileChooser#setFileFilter
24  * @see javax.swing.JFileChooser#addChoosableFileFilter
25  *
26  * @version 1.19 06/28/04
27  * @author Jeff Dinkins
28  */

29 public abstract class FileFilter {
30     /**
31      * Whether the given file is accepted by this filter.
32      */

33     public abstract boolean accept(File JavaDoc f);
34
35     /**
36      * The description of this filter. For example: "JPG and GIF Images"
37      * @see FileView#getName
38      */

39     public abstract String JavaDoc getDescription();
40 }
41
Popular Tags