rootStructureTernaryPane.getChildren().clear(); rootStructureTernaryPane.getChildren().add(ternaryMenu); animateShowTernaryMenu(); } else { Platform.runLater(() -> { rootStructureTernaryPane.getChildren().clear(); rootStructureTernaryPane.getChildren().add(ternaryMenu); animateShowTernaryMenu(); });