Rather than using 52 swith statements, is it possible to use a loop that can import images?
Atm my code is something like:
that class is called inside a for loop. However, i dnt think im doing this statement correctly as i get a null pointer exceptionCode://by K0502201 public void getImg(int counter) { //inFile = new File(counter + ".bmp") inFile = new File("img_" + counter + ".bmp"); try { img = ImageIO.read(inFile); } catch (IOException e) { System.out.println("Image error: " + e); } }
Any help is greatly aprreciated





Reply With Quote