JavaFX Node Is Child Of Class - Java JavaFX

Java examples for JavaFX:Node

Description

JavaFX Node Is Child Of Class

Demo Code


//package com.java2s;

import javafx.scene.Node;

public class Main {
    public static boolean NodeIsChildOfClass(Node child,
            Class<? extends Node> c) {
        if (child == null) {
            return false;
        } else if (c.isInstance(child)) {
            return true;
        } else {/*from  w  w  w.  j a v a2 s  .  com*/
            return NodeIsChildOfClass(child.getParent(), c);
        }
    }
}

Related Tutorials