Rectangle () { if (myScreenBounds == null) { return null; } Rectangle bounds = myEditButton.getBounds(); return new Rectangle(bounds.x + myScreenBounds.x, bounds.y + myScreenBounds.y, bounds.width, bounds.height); }