-
Bug
-
Resolution: Fixed
-
P4
-
8
-
existed in <=8.0b65 too
Run the code:
@Override
public void start(Stage stage) {
MenuBar mb = new MenuBar();
Menu menu = new Menu("Some menu");
mb.getMenus().add(menu);
final MenuItem item = new MenuItem("MenuItem");
item.setGraphic(new Rectangle(30, 30, Color.RED));
menu.getItems().add(item);
Button b = new Button("Remove graphic");
b.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
item.setGraphic(null);
}
});
VBox vb = new VBox();
vb.getChildren().addAll(mb, b);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}
Click the button.
Graphic node was not removed.
@Override
public void start(Stage stage) {
MenuBar mb = new MenuBar();
Menu menu = new Menu("Some menu");
mb.getMenus().add(menu);
final MenuItem item = new MenuItem("MenuItem");
item.setGraphic(new Rectangle(30, 30, Color.RED));
menu.getItems().add(item);
Button b = new Button("Remove graphic");
b.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
item.setGraphic(null);
}
});
VBox vb = new VBox();
vb.getChildren().addAll(mb, b);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}
Click the button.
Graphic node was not removed.