code: @Override
    public void show( final Component c, final int iX, final int iY )
    {
      super.show( c, iX, iY );
  
      EventQueue.invokeLater(
        () -> {
          if( !_bResizedWidth && _viewer.getWidth() > MAX_WIDTH )
          {
            //noinspection SuspiciousNameCombination
            _scroller.setPreferredSize( new Dimension( MAX_WIDTH, MAX_WIDTH ) );
            _bResizedWidth = true;
            pack();
            setVisible( false );
            show( c, iX, iY );
            return;
          }
          if( !_bResizedHeight && isViewerLessThanHalfFull() )
          {
            _scroller.setPreferredSize( new Dimension( MAX_WIDTH, _scroller.getHeight() / 2 ) );
            _bResizedHeight = true;
            pack();
            setVisible( false );
            show( c, iX, iY );
          }
        } );
    }
docs: --------------------------------------------------------------------------------------------------