Indeed, about 85% or more of that program can be thrown away for your specific purpose.
But it was what I had as example!
I also had to learn a lot to help coding that too.
Basically what you need is:
final static File[] getFolderContent(File dir) {
return dir.listFiles(pictsFilter);
}
And the
FilenameFilter object being used there as extension choice filter.
Just replace variable
exts content to use ".svg" instead:
final static String[] exts = {
".gif", ".png", ".jpeg", ".jpg"
};
final static FilenameFilter pictsFilter = new FilenameFilter() {
boolean accept(File dir, String name) {
name = name.toLowerCase();
for (int i = exts.length; i-- != 0;) if (name.endsWith(exts[i])) return true;
return false;
}
};
Problem is, function
getFolderContent(), which in turn merely calls
listFiles() method, demands a
File object.
However, that program doesn't explicit instantiates a
File object!
Rather, it uses 1 created by
selectFolder()'s thread.
Perhaps you should take a look @
http://docs.oracle.com/javase/6/docs/api/java/io/File.html yourself.
I still got a lot to learn from that
File class yet.
If you still got any problems, publish your current code here so we can try to reach your goal.