String[] fmts = ImageIO.getWriterFormatNames();
for ( int i=0; i<fmts.length; i++ ) {
String s = fmts[i].toLowerCase();
if ( s.length() == 3 && !seen.contains(s) ) {
seen.add(s);
chooser.setFileFilter(new SimpleFileFilter(s,
s.toUpperCase()+" Image (*."+s+")"));
}
}
seen.clear(); seen = null;
chooser.setAccessory(scaler);