posted 12 years ago
Group boardGroup = new Group();
ImageView stone1 = new ImageView(stone_image, x, y);
ImageView stone2 = new ImageView(stone_image, x, y);
ImageView stone3 = new ImageView(stone_image, x, y);
boardGroup.getChildren().add(stone1);
boardGroup.getChildren().add(stone2);
boardGroup.getChildren().add(stone3);
-- or --
boardGroup.getChildren().add(new ImageView(stone_image, x,y));
Scene scene = new Scene(boardGroup, 400, 400);
stage.setScene(scene);
stage.show();
Now the stones are on the screen. How do I remove them? I figured out how to do that by making them not visible but I would like to be able to actually remove the ImageView nodes. I've extended ImageView so I can find the node I want to delete but I don't know how to get rid of it.