-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
Fix Understood
-
generic
-
generic
Add the following helper method in Util
private static Component findComponent(final Container container,
final Predicate<Component> predicate) {
for (Component child : container.getComponents()) {
if (predicate.test(child)) {
return child;
}
if (child instanceof Container cont && cont.getComponentCount() > 0) {
Component result = findComponent(cont, predicate);
if (result != null) {
return result;
}
}
}
return null;
}
private static Component findComponent(final Container container,
final Predicate<Component> predicate) {
for (Component child : container.getComponents()) {
if (predicate.test(child)) {
return child;
}
if (child instanceof Container cont && cont.getComponentCount() > 0) {
Component result = findComponent(cont, predicate);
if (result != null) {
return result;
}
}
}
return null;
}