if (h != m_TextHeight) { m_TextHeight = h;
if (h != lastHeight) { lastHeight = h;
      public void stateChanged(ChangeEvent e) {	JViewport vp = (JViewport)e.getSource();	int h = vp.getViewSize().height; 	// If new content is added ViewSize changes. This event is also	// fired when the user moves the scrollbar - in this case we	// don't want to move it back to the bottom.	if (h != m_TextHeight) {	  m_TextHeight = h;	  int x = h - vp.getExtentSize().height;	  vp.setViewPosition(new Point(0, x));	}      }