Element nextLineElement = map.getElement(lineNo+1); int nextStart = nextLineElement.getStartOffset(); int nextEnd = nextLineElement.getEndOffset(); if(end + 1 >= buffer.getLength())
if(end >= buffer.getLength())
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		Buffer buffer = view.getBuffer();		Element map = buffer.getDefaultRootElement();		int lineNo = map.getElementIndex(view.getTextArea()			.getCaretPosition());		Element lineElement = map.getElement(lineNo);		int start = lineElement.getStartOffset();		int end = lineElement.getEndOffset();		Element nextLineElement = map.getElement(lineNo+1);		int nextStart = nextLineElement.getStartOffset();		int nextEnd = nextLineElement.getEndOffset();		if(end + 1 >= buffer.getLength())		{			view.getToolkit().beep();			return;		}		try		{			buffer.remove(end - 1,jEdit.getLeadingWhiteSpace(				buffer.getText(nextStart,nextEnd - nextStart)));			buffer.insertString(end - 1," ",null);		}		catch(BadLocationException bl)		{			bl.printStackTrace();		}	}