public static AbstractButton findAbstractButtonByName(Container container, String name) {
		Component[] comp = container.getComponents();
		for (Component element : comp) {
			if ((element instanceof AbstractButton button) &&
				name.equals(button.getName())) {
				return button;
			}
			else if (element instanceof Container subContainer) {
				AbstractButton b = findAbstractButtonByName(subContainer, name);
				if (b != null) {
					return b;
				}
			}
		}
		return null;
	}
Searches the sub-components of the given container and returns the
AbstractButton that has the specified name.

@param container container to search
@param name the button name (you must set this manually).
@return null if the button was not found
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java