My goal: to delete a child.
so i came up with this code:
Code:
//...
for (int i = 0; i < lista.size(); i++) {
Detalhe detalhe = (Detalhe) lista.get(i);
rel.getTurma().removerDetalhe(detalhe);
visual.info2.removeElement(detalhe);//descomentei agora
System.out.println("o detalhe a eliminar: " +
visual.lstDetalhe.getSelectedValue());
}
//...
but it deletes ... ALL children from my JList, and what i want is just to delete a selecteditem in the JList
info2 is my JList's listModel
My problem, i supose, lies in the fact that i'm totally unable to
isolate a single child from the JList, declare it as a
Detalhe (my children's name) and then delete it.[/code]
How can i grab a certain item from my JList and then tell hibernate/java that its a child(Detalhe) so that i can then delete it?
Thanks in advance