Java JFileChooser filter files for "File.txt" -


how can make jfilechooser filter filter "file.txt", can make filter ".txt" thats not want.

i'm going have string[] of files filter such as

string[] filters = new string[filterscount]; string[0] = "file.txt"; string[1] = "text.txt"; string[2] = "uncaptext.txt"; 

i want able browse files exact names, capitalization count "uncaptext.txt" accepted "uncaptext.txt" or "uncaptext.txt" won't.

this seems easy question couldn't find topic on it.

i suggest writing filter checks for...

return arrays.aslist(filters).contains(file.getname()); 

in other words, make list out of array (to have nice "contains" method) , ask list if name of file contained in it.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -