I need to loop through an ArrayList
of objects and add their ImageView
s to my main Group
which is root
in the code below. This is what I came up so far but still not working. Any idea?
for (int i = 0; i < myList.size(); i++) {
ImageView ii =myList.get(i).imageView;
root.getChildren().remove(bGroup);
Group bGroup = new Group();
bGroup.getChildren().add(ii); //NullPointerException
root.getChildren().add(bGroup);
}