Object (Object component, String name) { if (name.equals(get(component, "name"))) { return component; } String classname = getClass(component); String childname = null; String childname2 = null; if (("panel" == classname) || ("desktop" == classname) || ("splitpane" == classname) || ("dialog" == classname)) { childname = "component"; } else if ("combobox" == classname) { childname = "choice"; } else if ("tabbedpane" == classname) { childname = "tab"; childname2 = "component"; } else if ("list" == classname) { childname = "item"; } else if ("table" == classname) { childname = "column"; childname2 = "row"; } else if ("row" == classname) { childname = "cell"; } else if (("tree" == classname) || ("node" == classname)) { childname = "node"; } else if (("menubar" == classname) || ("menu" == classname)) { childname = "menu"; } while (childname != null) { for (Object comp = get(component, childname); comp != null; comp = get(comp, ":next")) { Object found = find(comp, name); if (found != null) { return found; } } childname = childname2; childname2 = null; } return null; }