Rectangle (@NotNull JComponent container) { Dimension iconSize = getPreferredSize(); return new Rectangle((container.getWidth() - iconSize.width) / 2, container.getPreferredSize().height - iconSize.height, iconSize.width, iconSize.height); }