final Dimension ps = scrollPane.getLayout ().preferredLayoutSize ( scrollPane );
final Dimension newPs = new Dimension ( startDim.width + ( ltr ? p.x - start.x : start.x - p.x ),
startDim.height + ( p.y - start.y ) * 2 );
scrollPane.setPreferredSize ( SwingUtils.max ( ps, newPs ) );
scrollPane.revalidate ();
scrollPane.repaint ();
}
}
@Override