Java tutorial
//package com.java2s; import javafx.scene.Node; import javafx.scene.layout.Pane; public class Main { /** * Utility method to remove a node. In particular, a full pane can be removed. * * @param node * The node to be removed. */ public static void remove(final Node node) { if (node.getParent() != null && node.getParent() instanceof Pane) { ((Pane) node.getParent()).getChildren().remove(node); } } }