Dimension () { Dimension size = super.getPreferredSize(); if (myHoldSize != null) { size.width = Math.max(size.width, myHoldSize.width); size.height = Math.max(size.height, myHoldSize.height); } return size; }