If you need a recursive way to test this,
public class NodeUtils { public static <T extends Pane> Map<Node, Object> formValues(T parent) { return formValues(parent, new HashMap<>()); } private static <T extends Pane> Map<Node, Object> formValues(T parent, Map<Node, Object> map) { for (Node node : parent.getChildren()) {
Testing source
Map<Node, Object> formValues = NodeUtils.formValues(source);
Get only nodes
public class NodeUtils { public static ArrayList<Node> getAllNodes(Parent root) { ArrayList<Node> nodes = new ArrayList<>(); addAllDescendents(root, nodes); return nodes; } private static void addAllDescendents(Parent parent, ArrayList<Node> nodes) {
Testing source
List<Node> nodes = NodeUtils.getAllNodes(aPaneOrAnotherParentObject);
source share