Rectangle (TextHitInfo offset) { Rectangle[] boxes = ObjectUtils.notNull(myRenderHandler.getCompositionCharactersBBoxes(), new Rectangle[]{getDefaultImePositions()}); Rectangle candidateWindowPosition = boxes.length == 0 ? getDefaultImePositions() : new Rectangle(boxes[0]); var componentLocation = getLocationOnScreen(); candidateWindowPosition.translate(componentLocation.x, componentLocation.y); return candidateWindowPosition; }