Here you can find the source of getImageFormats()
public static String getImageFormats()
//package com.java2s; //License from project: Apache License import javax.imageio.ImageIO; public class Main { public static String getImageFormats() { StringBuilder retval = new StringBuilder(); String[] formats = ImageIO.getReaderFormatNames(); for (int i = 0; i < formats.length; i++) { retval.append(formats[i]);// ww w .j av a2 s . co m if (i + 1 < formats.length) { retval.append(","); } } return retval.toString(); } }