ConcurrentModificationException while using Iterator<Node> [duplicate]
问题 This question already has answers here : Concurrent Modification Exception : adding to an ArrayList (10 answers) Closed 7 months ago . I was trying to delete a row of JavaFX GridPane with JavaFX Rectangles and I found no way to do so but copying the squares above to one row below . Here is my code to do that but it keeps throwing ConcurrentModificationAcception . static void copyAbove(int rowToBeDisappear, GridPane mainGrid) { for (int y = (rowToBeDisappear-1); 0 <= y ; y--) { for (int x = 0;