Advertisement
xlrnxnlx

FileExtension - min

Jul 4th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. package model;import java.io.File;import javax.swing.filechooser.FileFilter;public class FileExtension extends FileFilter{@Override
  2. public boolean accept(File f){String ext=f.getName().toLowerCase();return ext.endsWith("jpg")||ext.endsWith("jpeg")||ext.endsWith("png")||ext.endsWith("gif");}@Override
  3. public String getDescription(){return"Formatos: *.jpg, *.jpeg, *.png, *.gif";}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement