getPreferredScrollableViewportSize

The one scrollable child's answer plus this panel's insets, so a border or a shadow around it is not clipped.