(I can’t run it, old version of processing here)
// Files
ArrayList<File> arrayListWithFileObjects = new ArrayList();
String[] filenames;
//-------------------------------------------------------------------------------------------
void setup () {
size (1230, 700);
java.io.File folder = new java.io.File(dataPath(""));
filenames = folder.list();
printArray(filenames);
for (String s1 : filenames) {
arrayListWithFileObjects.add(new File(s1));
}
println("");
arrayListWithFileObjects.sort((f1, f2) -> Long.compare(f1.lastModified(), f2.lastModified()));
// arrayListWithStrings.sort((s1, s2) -> Long.compare(new File(s1).lastModified(), new File(s2).lastModified()));
for (File f1 : arrayListWithFileObjects) {
println(f1.getPath());
}
//
}//func
void draw () {
background(0);
}
//