JViewport vp = (JViewport)parent; Component view = vp.getView(); Rectangle portBounds = vp.getBounds();
JViewport port = (JViewport) parent; Component view = port.getView();       Rectangle portBounds = port.getViewRect(); Dimension viewSize = port.getViewSize();
  public void layoutContainer(Container parent)   {    JViewport vp = (JViewport)parent;    Component view = vp.getView();    Rectangle portBounds = vp.getBounds();    Dimension viewMinimum = view.getMinimumSize();    int width = Math.max(portBounds.width,                          viewMinimum.width);    int height = Math.max(portBounds.height,                           viewMinimum.height);    int x = Math.min(0, portBounds.width - width);    int y = Math.min(0, portBounds.height - height);    // System.err.println(this + ".layoutContainer() : width = " + width + ", height = " + height);    vp.setViewPosition(new Point(x, y));    vp.setViewSize(new Dimension(width, height));	}