public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
        int blockIncrement;
        if (orientation == SwingConstants.VERTICAL) {
            blockIncrement = visibleRect.height-(int)(10.0*screenAdjustment);
            if (direction < 0) {
                if (visibleRect.y < blockIncrement)
                    blockIncrement = visibleRect.y;
            } else {
                int y = visibleRect.y+visibleRect.height;
                Dimension size = getPreferredSize();
                if (y+blockIncrement > size.height)
                    blockIncrement = size.height-y;
            }
        } else {
            blockIncrement = visibleRect.width-(int)(10.0*screenAdjustment);
            if (direction < 0) {
                if (visibleRect.x < blockIncrement)
                    blockIncrement = visibleRect.x;
            } else {
                int x = visibleRect.x+visibleRect.width;
                Dimension size = getPreferredSize();
                if (x+blockIncrement > size.width)
                    blockIncrement = size.width-x;
            }
        }

        return blockIncrement;
    }