ListUI lui = this.getUI(); if (orientation == SwingConstants.VERTICAL) { if (direction > 0) {  Point bottomLeft = new Point(visibleRect.x, visibleRect.y + visibleRect.height); int curIdx = lui.locationToIndex(this, bottomLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y + curBounds.height == bottomLeft.y) {   if (curIdx + 1 < model.getSize()) {  Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1); return nxtBounds.height; } else {  return 0; } } else {   return (curBounds.y + curBounds.height) - bottomLeft.y; } } else {  Point topLeft = new Point(visibleRect.x, visibleRect.y); int curIdx = lui.locationToIndex(this, topLeft); Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx); if (curBounds.y == topLeft.y) {   if (curIdx > 0) {  Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1); return -nxtBounds.height; } else {  return 0; } } else {   return curBounds.y - topLeft.y; } } }
  public int getScrollableUnitIncrement(Rectangle visibleRect,                                        int orientation, int direction)  {    return 1;  }