Dimension () { Dimension size = super.getPreferredSize(); size.width = Math.max(size.width, DEFAULT_MINIMUM_BUTTON_SIZE.width); size.height = Math.max(size.height, DEFAULT_MINIMUM_BUTTON_SIZE.height); if (isPaintParentWhileLoading()) { Dimension parentSize = myParent.getSize(); size.width += parentSize.width; size.height = parentSize.height; } return size; }