@Override
        public Dimension getPreferredSize() {
          Dimension size = super.getPreferredSize();
          if (myPreferredHeightProvider != null) size.height = myPreferredHeightProvider.compute();
          return size;
        }
@Override
        public Dimension getPreferredSize()