i am trying to obtain File from the link list of File and then compare the obtained image with the existing image on imageView but it is giving null pointer exception enter code here
files.stream().map((file) -> file.toPath().toString()).forEachOrdered((string) -> {
try {
Image source =new Image(new FileInputStream(string));
if(source==image){
stringFilePath=string;
}
} catch (FileNotFoundException ex) {
Logger.getLogger(SecondFrameController.class.getName()).log(Level.SEVERE, null, ex);
}
i also tried it with for loop but the problem still exist
for(File file:files)
{
String string= file.toPath().toString();
try {
Image source =new Image(new FileInputStream(string));
if(source==image){
stringFilePath=string;
}
} catch (FileNotFoundException ex) {
Logger.getLogger(SecondFrameController.class.getName()).log(Level.SEVERE, null, ex);
}
}