{ try { buffer.beginCompoundEdit(); Selection[] selection = getSelection(); for(int i = 0; i < selection.length; i++) setSelectedText(selection[i],null); } finally { buffer.endCompoundEdit(); } }
setSelectedText("");
	public void backspace()	{		if(!buffer.isEditable())		{			getToolkit().beep();			return;		}		if(selection.size() != 0)		{			try			{				buffer.beginCompoundEdit();				Selection[] selection = getSelection();				for(int i = 0; i < selection.length; i++)					setSelectedText(selection[i],null);			}			finally			{				buffer.endCompoundEdit();			}		}		else		{			if(caret == 0)			{				getToolkit().beep();				return;			}			try			{				buffer.remove(caret - 1,1);			}			catch(BadLocationException bl)			{				Log.log(Log.ERROR,this,bl);			}		}	}