+
+ /**
+ * Descends one level to the child which has the specified class.
+ *
+ * @param parent the node with children
+ * @param classname the name of the class, as a string
+ * @return the child or <code>null</code> if the child is not found.
+ */
+ private Accessible descendByClass(Accessible parent, String classname) {
+ if (parent == null) return null;
+ AccessibleContext ac = parent.getAccessibleContext();
+ int children = ac.getAccessibleChildrenCount();
+ for (int i=0; i<children; i++) {
+ Accessible child = ac.getAccessibleChild(i);
+ if (child.getClass().getName() == classname) {
+ if (dtxt!=null) dtxt.println("DESCEND CLASS "+classname+" OK");
+ return child;
+ }
+ }
+ if (dtxt!=null) dtxt.println("DESCEND CLASS "+classname+" NOT FOUND");
+ return null;
+ }
+