dump JavaFX Node - Java JavaFX

Java examples for JavaFX:Node

Description

dump JavaFX Node

Demo Code


//package com.java2s;
import javafx.scene.Node;
import javafx.scene.Parent;

public class Main {
    public static void dump(Node n) {
        System.out.println("Dumping Node: '" + n + "'");
        dump(n, 0);//w  ww . jav  a  2 s  . com
    }

    private static void dump(Node n, int depth) {
        for (int i = 0; i < depth; i++)
            System.out.print("  ");
        System.out.println(n);
        if (n instanceof Parent)
            for (Node c : ((Parent) n).getChildrenUnmodifiable())
                dump(c, depth + 1);
    }
}

Related Tutorials