Hey all, I have a Java problem. For my senior research class, I\'m pretty much finished but I just have to analyze some data in images I generated. I don\'t want to tag this as
In the problematic line, shouldn't it been actualFiles[i]
instead of expectedFiles[i]
?
new File("C:\\Users\\Rowe\\workspace\\Senior Research\\testExpect"+expectedFiles[i])
Let's shorten the directory to C:\\yourDir
. Your code will be yielding paths like
C:\\yourDirexpectedFiles1.bmp
Not what you want:
C:\\yourDir\\expectedFiles1.bmp
You forgot the path separator.
It is much better to use the two-File-arg constructor to File
:
File actualImageFile = new File(actualDir, expectedFiles[i]);
actualImage = ImageIO.read(actualImageFile);
Hope that helps!