# Java Notes

# File Filters

There are two common uses of file filters, which restrict the choice of files.

- To display only specific files in a file chooser dialog. See javax.swing.filechooser.FileFilter class.
- To restrict the list returned from the File class listfiles method. See java.io.FileFilter interface.

## Potential Name Conflict

If you import both `javax.swing.filechooser.*` and `java.io.*`, you will have a name conflict because both file filters use the same name. Use the fully qualified name in your code to eliminate these problems.