The javadoc for Labeled's graphic property says "The node specified for this variable cannot appear elsewhere in the scene graph, otherwise IllegalArgumentException is thrown".
The following code, then, should throw an IAE but it does not:
@Override
public void start(Stage stage) throws Exception {
VBox root = new VBox(10);
TextArea bar = new TextArea();
root.getChildren().add(bar);
Label label = new Label("foo", bar);
root.getChildren().add(label);
Scene scene = new Scene(root, 300, 250);
stage.setScene(scene);
stage.show();
}
The following code, then, should throw an IAE but it does not:
@Override
public void start(Stage stage) throws Exception {
VBox root = new VBox(10);
TextArea bar = new TextArea();
root.getChildren().add(bar);
Label label = new Label("foo", bar);
root.getChildren().add(label);
Scene scene = new Scene(root, 300, 250);
stage.setScene(scene);
stage.show();
}
- relates to
-
JDK-8117203 Index out of bounds in CSS processor
-
- Resolved
-