The approach in the OP seems to overthink the problem. The following code does exactly what the OP code would probably do if it was valid:
Group group = new Group(new Button("Hello"));
Of course it's going to be difficult to do anything with that button since there's no action associated with it. The straight-ahead approach is to just instantiate it as a variable, add an action and then put it in the new Group:
Button button = new Button("Hello");
button.setOnAction(evt -> System.out.println("hello"));
Group group = new Group(button);
If you are going to set up a lot of buttons with nothing more than a label and an action, then it makes sense to set up a "builder" method to make it easier. Then you can in-line the method call when setting up the Group:
private Node createButton(String label, EventHandler<ActionEvent> handler) {
Button result = new Button(label);
result.setOnAction(handler);
return result;
}
And call it like so:
Group group = new Group(createButton("Hello", evt -> System.out.println("Hello")));
Of course, if you are going to do this a lot, then it makes sense to create a static library of convenience methods that will do this sort of thing. Then you can inline huge amounts of code and stick to the DRY principle:
Group group = new Group(TextWidgets.headingText("A Heading"),
TextWidgets.boundDataText(stringProperty),
createButton("Hello", evt -> System.out.println("Hello")));
The JavaFX controls are just Java classes like any others, and there's really nothing special about creating them and calling their methods to configure them and connect them together.