@Override
      public Dimension getPreferredSize() {
        final Dimension preferredSize = super.getPreferredSize();
        final Container parent = getParent();
        if (parent != null) {
          return new Dimension(preferredSize.width, Math.min(150, preferredSize.height));
        }
        return preferredSize;
      }
@Override
      public Dimension getPreferredSize()