return doc.getText(getSelectionStart(), getSelectionEnd());
return doc.getText(start, offset);
  public String getSelectedText()  {    try      {	return doc.getText(getSelectionStart(), getSelectionEnd());      }    catch (BadLocationException e)      {	// This should never happen.	return null;      }  }