Filtering filechooser via filename
问题 I learned how to use filter using filefilter. FileFilter filter = new FileNameExtensionFilter("JPEG file", "jpg", "jpeg"); But I want to filter my filechooser with files containing certain strings in them like having "sample" in their filenames. Only files that does have these strings can be chosen and this filter must not be editable. How can I do it? 回答1: public class ImageFilter extends FileFilter { //Accept all directories and all jpeg, jpg files with lossy in its filename. public boolean