0
I’m having trouble with a code. I am creating a form with a profile photo, but when you make a photo change in EDIT, I would like the photo to be deleted from the images folder. Today I can only delete and change the photo, but the old one remains. The code below is what I use to delete a record from my list:
public void apagar(UsuarioModel selcionado){
if (selecionado != null){
try{
if (new UsuarioDao().apagar(selecionado)){
lista.remove(selcionado);
}
}catch(Exception e){
System.out.println(e.getMessage());
}
}
}