Прошу помощи, никак не могу найти инфо как добавить элемент на уже существующий Scene. Не хочу писать прогу на костылях.
public class Application extends javafx.application.Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Application.class.getResource("appView.fxml"));
// Parent root = fxmlLoader.getRoot();
Scene scene = new Scene(fxmlLoader.load(), 800, 600);
stage.setScene(scene);
stage.show();
}
// Button button2 = new Button("Button with Text & Image");
// root.getChildrenUnmodifiable().add(button2);
// public AnchorPane anchInit() {
// AnchorPane ap = new AnchorPane();
// Button button2 = new Button("Button with Text & Image");
// ap.getChildren().add(button2);
// return ap;
// }
public static void main(String[] args) {
launch();
}
}