Java examples for JavaFX:Node
lookup Within JavaFX Node
//package com.java2s; import javafx.scene.Node; public class Main { @SuppressWarnings("unchecked") public static <T> T lookupWithinNode(final Node parent, final String query, final Class<T> clazz) { for (Node node : parent.lookupAll(query)) { if (node.getClass().isAssignableFrom(clazz)) { return (T) node; }/*www . jav a2 s . c o m*/ } throw new IllegalArgumentException("Parent " + parent + " doesn't contain node matching query " + query); } }