Here you can find the source of getNewImageFileChooser()
public static JFileChooser getNewImageFileChooser()
//package com.java2s; //License from project: Open Source License import javax.swing.JFileChooser; import javax.swing.filechooser.FileNameExtensionFilter; public class Main { public static final FileNameExtensionFilter FILE_FILTER_EXCEL = new FileNameExtensionFilter( "Planilhas do Excel (*.xls; *.xlsx)", "xls", "xlsx"); public static final FileNameExtensionFilter FILE_FILTER_CSV = new FileNameExtensionFilter( "Arquivos CSV (*.csv; *.txt)", "csv", "txt"); public static final FileNameExtensionFilter FILE_FILTER_PNG = new FileNameExtensionFilter("Imagens PNG (*.png)", "png"); public static final FileNameExtensionFilter FILE_FILTER_TIFF = new FileNameExtensionFilter( "Imagens TIFF (*.tif; *.tiff)", "tif", "tiff"); public static JFileChooser getNewImageFileChooser() { return getNewFileChooser(FILE_FILTER_TIFF, FILE_FILTER_PNG); }/*from w ww. jav a 2 s . c o m*/ public static JFileChooser getNewFileChooser() { return getNewFileChooser(FILE_FILTER_EXCEL, FILE_FILTER_CSV); } public static JFileChooser getNewFileChooser(FileNameExtensionFilter... extensionFilters) { JFileChooser fileChooser = new JFileChooser(System.getProperty("user.dir")); fileChooser.setAcceptAllFileFilterUsed(false); for (FileNameExtensionFilter extensionFilter : extensionFilters) { fileChooser.addChoosableFileFilter(extensionFilter); } return fileChooser; } }