if (getOrientation() == 0 && location > jc.getSize().height)
Dimension size = jc.getSize();  if (size.width == 0 && size.height == 0) size = jc.getPreferredSize();  if (getOrientation() == 0 && location > size.height)
  public void setDividerLocation(JSplitPane jc, int location)  {    location = validLocation(location);    Container p = jc.getParent();    Dimension rightPrefSize = jc.getRightComponent().getPreferredSize();    if (getOrientation() == 0 && location > jc.getSize().height)      {        location = jc.getSize().height;        while (p != null)          {            p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height);            p = p.getParent();          }      }    else if (location > jc.getSize().width)      {        location = jc.getSize().width;        while (p != null)          {            p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight());            p = p.getParent();          }      }        setLastDragLocation(getDividerLocation(splitPane));    splitPane.setLastDividerLocation(getDividerLocation(splitPane));    int[] tmpSizes = layoutManager.getSizes();    tmpSizes[0] = location                  - layoutManager.getInitialLocation(splitPane.getInsets());    tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(),                                                 splitPane.getInsets())                  - tmpSizes[0];    layoutManager.setSizes(tmpSizes);    splitPane.revalidate();    splitPane.repaint();  }