I would like to remove an object from an ArrayList
when I'm done with it, but I can't find way to do it. Trying to remove it like in the sample code below doesn't want to work. How could I get to the iterator of current px
object in this loop to remove it?
for( Pixel px : pixel){
[...]
if(px.y > gHeigh){
pixel.remove(pixel.indexOf(px)); // here is the thing
pixel.remove(px); //doesn't work either
}
}