FileDialog.setFilter

Overview | Methods | This Package | All Packages

FileDialog.setFilter

Sets the current filter string (the string that determines the choices that appear in the Save as file type or Files of type box in the dialog box and allow the user to filter out the kinds of files that are shown in the dialog box).

Syntax

public final void setFilter( String value )

Parameters

value

A string that contains information about all the available file filters in the dialog box. For each filter, the filter string contains a description of the filter, followed by the vertical bar (|), followed by the filter pattern. The strings for different filters are separated by the "|" character. The following is an example of a filter string: "Text files (*.txt)|*.txt|All files (*.*)|*.*" To specify multiple filter patterns for a single filter, use a semicolon to separate the patterns (for example, "*.txt;*.doc;*.bak"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. Filters are displayed in the dialog box in the order they are specified in the value parameter to the setFilter property.

Remarks

See the OpenFileDialog control topic for a code example using this method.

See Also   getFilter