Element element = map.getElement(Integer .parseInt(line) - 1); if(element != null) view.getTextArea().setCaretPosition(element .getStartOffset());
try { Element element = map.getElement(Integer .parseInt(line) - 1); if(element != null) view.getTextArea().setCaretPosition( element.getStartOffset()); } catch(NumberFormatException nf) { view.getToolkit().beep(); }
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		Buffer buffer = view.getBuffer();		SyntaxTextArea textArea = view.getTextArea();		Element map = buffer.getDefaultRootElement();		String line = (String)JOptionPane.showInputDialog(view,			jEdit.getProperty("gotoline.message"),		jEdit.getProperty("gotoline.title"),			JOptionPane.QUESTION_MESSAGE,null,null,			String.valueOf(map.getElementIndex(textArea				.getCaretPosition()) + 1));		if(line != null)		{			Element element = map.getElement(Integer				.parseInt(line) - 1);			if(element != null)				view.getTextArea().setCaretPosition(element					.getStartOffset());		}	}