Dimension () { final Dimension d = super.getPreferredSize(); if (ANCHOR_TOP == myAnchor || ANCHOR_BOTTOM == myAnchor) { //noinspection SuspiciousNameCombination d.height = DIVIDER_WIDTH; } else { d.width = DIVIDER_WIDTH; } return d; }