setCursor(wait);  TableModel m = answerAll.getModel();  String name = names[row]; status.setText("Getting " + name); String title = (String) m.getValueAt(row, 1); if (title.equals("")) docHtmlFrame.setTitle(name); else docHtmlFrame.setTitle(title); currentDocId = docids[row];  int [] ids = new int[1]; ids[0] = currentDocId;  ParsedDocument[] docs = env.documents(ids); currentParsedDoc = docs[0]; String myDocText = currentParsedDoc.text;  docHtmlPane.setContentType("text/html"); docHtmlPane.setText(myDocText);  docHtmlPane.setCaretPosition(0); if (! docHtmlFrame.isShowing()) { docHtmlFrame.setLocationRelativeTo(query); docHtmlFrame.setVisible(true);
try { setCursor(wait); docTextFrame.setCursor(wait); docTextPane.setCursor(wait);  TableModel m = answerAll.getModel();  String name = names[row]; status.setText("Getting " + name); String title = (String) m.getValueAt(row, 1); if (title.equals("")) docTextFrame.setTitle(name); else docTextFrame.setTitle(title); currentDocId = docids[row];  int [] ids = new int[1]; ids[0] = currentDocId;  if (Thread.interrupted()) { throw new InterruptedException(); }  ParsedDocument[] docs = env.documents(ids);   if (Thread.interrupted()) { throw new InterruptedException(); } currentParsedDoc = docs[0]; String myDocText = currentParsedDoc.text;       StringBuffer buf = new StringBuffer(); buf.ensureCapacity(myDocText.length());      for (int i = 0; i < myDocText.length(); i++) { char c = myDocText.charAt(i);   if (c == 8220) buf.append(" ''"); else if (c == 8221) buf.append("'' "); else if (c == 931) {    buf.append(" "); buf.append(c); } else if (c > 255) {  buf.append("  "); buf.append(c);        } else if (c == 204 || c == 174) { buf.append(" "); buf.append(c);  }  else if (c == '\r') buf.append(' '); else buf.append(c);  if ((i%1000) == 0 && Thread.interrupted()) { throw new InterruptedException(); } } myDocText = buf.toString();  docTextPane.setContentType("text/plain"); docTextPane.setText(myDocText);  docTextPane.setCaretPosition(0);  if (! docTextFrame.isShowing()) { docTextFrame.setLocationRelativeTo(query); docTextFrame.setVisible(true); }  if (Thread.interrupted()) { throw new InterruptedException(); }   DefaultTreeModel tree = (DefaultTreeModel) docQueryTree.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) tree.getRoot();  highlight(root); status.setText(" "); } catch (InterruptedException ex) {  status.setText(" "); } catch (OutOfMemoryError er) { status.setText("Out of Memory. Unable to open document");
		public void run() {		    setCursor(wait);		    // get the doc text		    TableModel m = answerAll.getModel();		    //String name = (String) m.getValueAt(row, 0);		    String name = names[row];		    status.setText("Getting " + name);		    String title = (String) m.getValueAt(row, 1);		    if (title.equals(""))			docHtmlFrame.setTitle(name);		    else			docHtmlFrame.setTitle(title);		    currentDocId = docids[row]; // internal docid		    // get the parsed document		    int [] ids = new int[1];		    ids[0] = currentDocId;		    		    ParsedDocument[] docs = env.documents(ids);		    currentParsedDoc = docs[0];		    String myDocText = currentParsedDoc.text;		    // insert into doc text pane		    docHtmlPane.setContentType("text/html");		    docHtmlPane.setText(myDocText);		    // reset caret to start of doc text.		    docHtmlPane.setCaretPosition(0);		    if (! docHtmlFrame.isShowing()) {			docHtmlFrame.setLocationRelativeTo(query);			docHtmlFrame.setVisible(true);		    }		    status.setText(" ");		    setCursor(def);		}