List of usage examples for java.awt Component contains
public boolean contains(int x, int y)
From source file:Util.java
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; }//from ww w. j av a2 s . c o m return null; }