Java Image getNewImageFileChooser()

Here you can find the source of getNewImageFileChooser()

Description

get New Image File Chooser

License

Open Source License

Declaration

public static JFileChooser getNewImageFileChooser() 

Method Source Code

//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;

    }
}

Related

  1. GetImagenConTamanioDado(File file, int ancho, int alto)
  2. getImageWithBorder(Image imagen)
  3. getInputStreamFromImage(Image imagen, String format)
  4. getLogoImage()
  5. getManagedImage(Component source, String file, float tint, Color solid)
  6. getOpenSwingImage(String name)
  7. getPanelImage(JPanel p)
  8. getScreenShareImage()
  9. getShieldImage()