add(new JScrollPane(m_List), BorderLayout.CENTER);
final JScrollPane js = new JScrollPane(m_List); js.getViewport().addChangeListener(new ChangeListener() { private int lastHeight; public void stateChanged(ChangeEvent e) { JViewport vp = (JViewport)e.getSource(); int h = vp.getViewSize().height; if (h != lastHeight) { lastHeight = h; int x = h - vp.getExtentSize().height; vp.setViewPosition(new Point(0, x)); } } }); add(js, BorderLayout.CENTER);
  public ResultHistoryPanel(JTextComponent text) {        m_SingleText = text;    m_List.addMouseListener(new MouseAdapter() {      public void mouseClicked(MouseEvent e) {	if ((e.getModifiers() & InputEvent.BUTTON1_MASK)	    == InputEvent.BUTTON1_MASK) {	  int index = m_List.locationToIndex(e.getPoint());	  if ((index != -1) && (m_SingleText != null)) {	    setSingle((String)m_Model.elementAt(index));	  }	} else {	  int index = m_List.locationToIndex(e.getPoint());	  if (index != -1) {	    openFrame((String)m_Model.elementAt(index));	  }	}      }    });    setLayout(new BorderLayout());    //    setBorder(BorderFactory.createTitledBorder("Result history"));    add(new JScrollPane(m_List), BorderLayout.CENTER);  }