public int getNextImage() { int img; index.increment(); switch (index.getCounter()) { case 1: img = img1; break; case 2: img = img2; break; case 3: img = img3; break; case 4: img = img4; break; default: return 0; } System.out.println("index = " + index + "; nextImg()"); return img; }