Rectangle () { if (myCloseButton == null || myScreenBounds == null) { return null; } Rectangle buttonBounds = SwingUtilities.convertRectangle(myCloseButton.getParent(), myCloseButtonBounds, myAnimationPanel); buttonBounds.x += myScreenBounds.x; buttonBounds.y += myScreenBounds.y; return buttonBounds; }