@Override
        public boolean accept(File f) {
            if (f.isDirectory()) {
                return true;
            }
            String suffix = f.getAbsolutePath();
            suffix = suffix.substring(suffix.lastIndexOf(".") + 1);
            if (filesType == FileChooser.FILES_TYPE_IMAGE) {
                for (String ethanol : images) {
                    if (compareSuffix(ethanol, suffix)) {
                        return true;
                    }
                }
            } else if (filesType == FileChooser.FILES_TYPE_PNG) {
                return compareSuffix("PNG", suffix);
            }
            return false;
        }