void (Object component, int x, int y) { referencex = x; referencey = y; for (; component != null; component = getParent(component)) { Rectangle bounds = getRectangle(component, "bounds"); referencex += bounds.x; referencey += bounds.y; } }