Point (ActionButtonComponent actionButton, Icon icon) { Rectangle rect = new Rectangle(actionButton.getWidth(), actionButton.getHeight()); Insets i = actionButton.getInsets(); JBInsets.removeFrom(rect, i); int x = i.left + (rect.width - icon.getIconWidth()) / 2; int y = i.top + (rect.height - icon.getIconHeight()) / 2; return new Point(x, y); }