diff --git a/PlayWall/src/main/java/de/tobias/playpad/util/NodeWalker.java b/PlayWall/src/main/java/de/tobias/playpad/util/NodeWalker.java index 420edf917dc277773e56a49841ef2b4be0f17b3b..7a2a2b6a86c8a360606310494a7e11737a612020 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/util/NodeWalker.java +++ b/PlayWall/src/main/java/de/tobias/playpad/util/NodeWalker.java @@ -2,6 +2,7 @@ package de.tobias.playpad.util; import javafx.scene.Node; import javafx.scene.Parent; +import javafx.scene.control.Labeled; import java.util.ArrayList; import java.util.List; @@ -21,6 +22,14 @@ public class NodeWalker { private static void addAllDescendents(Parent parent, List<Node> nodes) { for (Node node : parent.getChildrenUnmodifiable()) { nodes.add(node); + + if (node instanceof Labeled) { + final Node graphic = ((Labeled) node).getGraphic(); + if (graphic != null) { + nodes.add(graphic); + } + } + if (node instanceof Parent) addAllDescendents((Parent) node, nodes); }