Java JFileChooser Filter list(ArrayList list, File file, javax.swing.filechooser.FileFilter filter)

Here you can find the source of list(ArrayList list, File file, javax.swing.filechooser.FileFilter filter)

Description

list

License

Apache License

Declaration

private static void list(ArrayList<File> list, File file, javax.swing.filechooser.FileFilter filter) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.util.ArrayList;

public class Main {

    private static void list(ArrayList<File> list, File file, javax.swing.filechooser.FileFilter filter) {
        if (filter.accept(file)) {
            list.add(file);//from  ww  w  .j  av a  2s.  com
            if (file.isFile()) {
                return;
            }
        }
        if (file.isDirectory()) {
            File files[] = file.listFiles();
            for (int i = 0; i < files.length; i++) {
                list(list, files[i], filter);
            }
        }

    }
}

Related

  1. getHostFileFilters()
  2. getKCTapFileFilter()
  3. getManikaFileFilter()
  4. getMostRecentFile(File dir, java.io.FileFilter filter)
  5. getWavFileFilter()
  6. listAll(File file, javax.swing.filechooser.FileFilter filter)
  7. listAll(File file, javax.swing.filechooser.FileFilter filter)
  8. makeFileFilter(final String desc, final String... types)
  9. makeFileNameExtensionFilter(String[] extensions)