if(!editable)
if(!isEditable())
	public void setSelectedText(String selectedText)	{		if(!editable)		{			throw new InternalError("Text component"				+ " read only");		}		buffer.beginCompoundEdit();		try		{			if(rectSelect)			{				Element map = buffer.getDefaultRootElement();				int start = selectionStart - map.getElement(selectionStartLine)					.getStartOffset();				int end = selectionEnd - map.getElement(selectionEndLine)					.getStartOffset();				// Certain rectangles satisfy this condition...				if(end < start)				{					int tmp = end;					end = start;					start = tmp;				}				int lastNewline = 0;				int currNewline = 0;				for(int i = selectionStartLine; i <= selectionEndLine; i++)				{					Element lineElement = map.getElement(i);					int lineStart = lineElement.getStartOffset();					int lineEnd = lineElement.getEndOffset() - 1;					int rectStart = Math.min(lineEnd,lineStart + start);					buffer.remove(rectStart,Math.min(lineEnd - rectStart,						end - start));					if(selectedText == null)						continue;					currNewline = selectedText.indexOf('\n',lastNewline);					if(currNewline == -1)						currNewline = selectedText.length();					buffer.insertString(rectStart,selectedText						.substring(lastNewline,currNewline),null);					lastNewline = Math.min(selectedText.length(),						currNewline + 1);				}				if(selectedText != null &&					currNewline != selectedText.length())				{					int offset = map.getElement(selectionEndLine)						.getEndOffset() - 1;					buffer.insertString(offset,"\n",null);					buffer.insertString(offset + 1,selectedText						.substring(currNewline + 1),null);				}			}			else			{				buffer.remove(selectionStart,					selectionEnd - selectionStart);				if(selectedText != null)				{					buffer.insertString(selectionStart,						selectedText,null);				}			}		}		catch(BadLocationException bl)		{			bl.printStackTrace();			throw new InternalError("Cannot replace"				+ " selection");		}		// No matter what happends... stops us from leaving buffer		// in a bad state		finally		{			buffer.endCompoundEdit();		}		setCaretPosition(selectionEnd);	}