Element lineElement = map.getElement(map.getElementIndex( caret));
Element lineElement = map.getElement( view.getTextArea().getCaretLine());
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		if(!view.getTextArea().isEditable())		{			view.getToolkit().beep();			return;		}		int caret = view.getTextArea().getCaretPosition();		Buffer buffer = view.getBuffer();		Element map = buffer.getDefaultRootElement();		Element lineElement = map.getElement(map.getElementIndex(			caret));		try		{			buffer.remove(caret,lineElement.getEndOffset()				- caret - 1);		}		catch(BadLocationException bl)		{			/* now, if anybody from Sun is reading this, let			 * me make myself clear: BadLocationException SUX.			 * why not throw a StringIndexOutOfBounds, or at			 * least make BadLocationException a RuntimeException?			 */		}	}