int newFirstLine = lineCount - visibleLines; if(newFirstLine != firstLine && newFirstLine >= 0)
int newFirstLine = Math.max(0,lineCount - visibleLines); if(newFirstLine != firstLine)
	public void updateScrollBars()	{		if(vertical != null && visibleLines != 0)		{			// don't display stuff past the end of the buffer if			// we can help it			int lineCount = getVirtualLineCount();			if(lineCount < firstLine + visibleLines)			{				// this will call updateScrollBars(), so				// just return...				int newFirstLine = lineCount - visibleLines;				if(newFirstLine != firstLine					&& newFirstLine >= 0)				{					setFirstLine(newFirstLine);					return;				}			}			vertical.setValues(firstLine,visibleLines,0,lineCount);			vertical.setUnitIncrement(2);			vertical.setBlockIncrement(visibleLines);		}		int width = painter.getWidth();		if(horizontal != null && width != 0)		{			maxHorizontalScrollWidth = 0;			painter.repaint();			horizontal.setUnitIncrement(painter.getFontMetrics()				.charWidth('w'));			horizontal.setBlockIncrement(width / 2);		}	}