How to remove individual nodes within groups on a pane javafx
<p>I have run into a roadblock in my programming.  I have an array of groups of arcs on a pane (HE.getDatabase()) is an array of groups of arcs.  I am trying to loop through them and remove any arc that has a fill of BLACK.  If I try to make them green it works and every single Arc that has a fill of BLACK will go to green using the same loop.  LIke this:</p>

<pre><code>main.getDeleteSelected().setOnAction(b -&gt; {
    for( int i=0; i &lt; HE.getDatabase().size(); i++){
        for(Node one: HE.getDatabase().get(i).getChildren()){
            if (((Arc) one).getFill() == Color.BLACK){
                ((Arc) one).setFill(Color.GREEN);
            }
        }

    }
});
</code></pre>

<p>But if I try to remove the Arc it will only remove one or two on the specified action at a time.  Like this:</p>

<pre><code>main.getDeleteSelected().setOnAction(b -&gt; {
    for( int i=0; i &lt; HE.getDatabase().size(); i++){
        for(Node one: HE.getDatabase().get(i).getChildren())        {
            if (((Arc) one).getFill() == Color.BLACK){
                HE.getDatabase().get(i).getChildren().remove(one);
            }
        }

    }
});
</code></pre>

<p>I have to keep hitting the menu item several times to get rid of all of the BLACK filled arcs.  I'm pretty sure it has to do with the group.getChildren().remove(selected) portion of the code.  Any help on this would be greatly appreciated.  Is there another way to get rid of a node without referencing the parent?</p>