RelativePoint (@NotNull Component comp) { if (!(comp instanceof JComponent jcomp)) return defaultPointUnderneathOf(comp); Point offset = new Point(calcHorizontalAlignment(jcomp), 0); return new AnchoredPoint(AnchoredPoint.Anchor.BOTTOM_LEFT, comp, offset); }