The program is responsible for implementing the custom task for which the file chooser was created. By default, a file chooser displays all of the files and directories that it detects, except hidden files. A program can apply one or more file filters to a file chooser so that the chooser shows only some files. The file chooser calls the filter's accept method for each file to determine whether it should be displayed. A file filter accepts or rejects a file based on some criteria such as file type, size, ownership, and so on.
Filters affect the list of files displayed by the file chooser.
The user can enter the name of any file even if it's not displayed. JFileChooser supports three different kinds of filtering. The filters are checked in the order listed here. So a filter of the second type can filter only those files accepted by the first, and so on. Built-in filtering Filtering is set up through specific method calls on a file chooser.