m_Printer = new PrintableComponent(m_SingleText);
if (text != null) { m_Printer = new PrintableComponent(m_SingleText); }
  public ResultHistoryPanel(JTextComponent text) {    m_SingleText = text;    m_Printer = new PrintableComponent(m_SingleText);    m_List.addMouseListener(new RMouseAdapter() {      public void mouseClicked(MouseEvent e) {	if ((e.getModifiers() & InputEvent.BUTTON1_MASK)	    == InputEvent.BUTTON1_MASK) {            if (    ((e.getModifiers() & InputEvent.SHIFT_DOWN_MASK) == 0)                 && ((e.getModifiers() & InputEvent.CTRL_DOWN_MASK) == 0) ) {              int index = m_List.locationToIndex(e.getPoint());              if ((index != -1) && (m_SingleText != null)) {                setSingle((String)m_Model.elementAt(index));            }          }	} else {	  // if there are stored objects then assume that the storer	  // will handle popping up the text in a seperate frame	  if (m_HandleRightClicks) {	    int index = m_List.locationToIndex(e.getPoint());	    if (index != -1) {	      String name = (String)m_Model.elementAt(index);	      openFrame(name);	    }	  }	}      }    });    m_List.addKeyListener(new RKeyAdapter() {      public void keyReleased(KeyEvent e) {        if (e.getKeyCode() == KeyEvent.VK_DELETE) {          int selected = m_List.getSelectedIndex();          if (selected != -1) {            removeResult((String)m_Model.elementAt(selected));          }        }      }    });    m_List.getSelectionModel()      .addListSelectionListener(new ListSelectionListener() {      public void valueChanged(ListSelectionEvent e) {	if (!e.getValueIsAdjusting()) {	  ListSelectionModel lm = (ListSelectionModel) e.getSource();	  for (int i = e.getFirstIndex(); i <= e.getLastIndex(); i++) {	    if (lm.isSelectedIndex(i)) {	      //m_AttSummaryPanel.setAttribute(i);	       if ((i != -1) && (m_SingleText != null)) {		 setSingle((String)m_Model.elementAt(i));	       }	      break;	    }	  }	}      }    });    setLayout(new BorderLayout());    //    setBorder(BorderFactory.createTitledBorder("Result history"));    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) { // i.e. an addition not just a user scrolling	  lastHeight = h;	  int x = h - vp.getExtentSize().height;	  vp.setViewPosition(new Point(0, x));	}      }    });    add(js, BorderLayout.CENTER);  }