code: public static Treenode findNodeByLabel(Treeview tree, String label, boolean caseSensitive) {
          for (Treenode item : tree.getChildren(Treenode.class)) {
              if (caseSensitive ? label.equals(item.getLabel()) : label.equalsIgnoreCase(item.getLabel())) {
                  return item;
              }
          }
  
          return null;
      }
docs: Search the entire tree for a tree item matching the specified label.
  
  @param tree Tree containing the item of interest.
  @param label Label to match.
  @param caseSensitive If true, match is case-sensitive.
  @return The matching tree item, or null if not found.