Array of Images Error (loading of images)

ok, so the second code runs with the images flower0, flowers1 and flowers2

The same images from your initial Sketch / game?

What does this print please?



void setup() {
  size(770, 770);

  PImage[] list = loadImages();
  println (list.length);

  if (list.length>0) 
    image(list[0], 0, 0);
  else {
    println ("no image found");
  }
}

PImage[] loadImages() {
  java.io.File folder = new java.io.File(dataPath("")+"/");
  String[] filenames = folder.list();

  PImage[] img = new PImage[filenames.length];
  for (int i = 0; i < filenames.length; i++) {
    println(dataPath("") + "/" + filenames[i]); 
    img[i] = loadImage(dataPath("") + "/" + filenames[i]);
  }
  return img;
}