I already know how to do this when it comes to AnchorPane
, it's something like this:
AnchorPane ap = new AnchoPane();
Label lbl = new Label("Qualquer");
ap.getChildren().add(lbl);
But when it comes to a Pane
normal, I can only call getChildrenUnmodifiable()
, and if I then call add(lbl)
the following exception is thrown:
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Can anyone help me?