I want to add two different filenamefilter to the same FileDialog object. My below code works, when I try to add more than one to the same FileDialog object, it breaks such that nothing seem as a file in the dialog window. How can I apply multiple file extension fil?
I used below code to create my own filenamefilter class(snce FileNameFilter is actually interface).

import java.io.*;
public class FileExtensionFilter implements FilenameFilter {
    private String extension;
    public FileExtensionFilter(String extension) {
        this.extension = extension;
    public boolean accept(File dir, String filename) {
         return filename.toLowerCase().endsWith(this.extensions);