import java.awt.Component;
import java.awt.Container;
import java.awt.Point;
public class Util{
public static final Component getVisibleChildAt(Container container, Point p) {
for (int i = 0; i < container.getComponentCount(); i++) {
Component c = container.getComponent(i);
if (c.isVisible() && c.contains(p.x - c.getX(), p.y - c.getY()))
return c;
}
return null;
}
}
|