Dimension (Insets i, Dimension size) { int iconWidth = DEFAULT_ICON.getIconWidth() + i.right; int iconHeight = DEFAULT_ICON.getIconHeight() + i.top + i.bottom; Dimension minSize = new Dimension(i.left + DarculaSpinnerUI.MINIMUM_WIDTH.get() + i.right, iconHeight); size = maximize(size, minSize); Dimension editorSize = spinner.getEditor() != null ? spinner.getEditor().getPreferredSize() : JBUI.emptySize(); Insets m = editorMargins(); return new Dimension(Math.max(size.width, i.left + m.left + editorSize.width + m.right + iconWidth), Math.max(size.height, i.top + m.top + editorSize.height + m.bottom + i.bottom)); }