List of usage examples for javax.swing.text BadLocationException printStackTrace
public void printStackTrace()
From source file:rita.widget.SourceCode.java
public void highlightCode(int line, int col) { try {//from www . j a v a2 s.com // Convertir a una posicion X/Y paneJavaCode.getHighlighter().addHighlight(paneJavaCode.getLineStartOffset(line - 1), paneJavaCode.getLineEndOffset(line - 1), new DefaultHighlightPainter(ErrorLineColor)); } catch (BadLocationException e) { e.printStackTrace(); } }
From source file:rita.widget.SourceCode.java
public void highlightCode(RenderableBlock renderableBlock) { try {/*from w w w .j a v a 2s. c o m*/ paneJavaCode.getHighlighter().removeAllHighlights(); int startPos = 0; // encontrar la posicion en funcion del numero de repeticion del // LABEL String labelToFind = renderableBlock.getBlock().getBlockLabel(); for (int i = 0; i < renderableBlock.getLabelInstanceNumber(); i++) { if (startPos > 0) startPos += labelToFind.length(); startPos = paneJavaCode.getText().indexOf(labelToFind, startPos); } int lastPos = startPos + renderableBlock.getBlock().getBlockLabel().length(); paneJavaCode.getHighlighter().addHighlight(startPos, lastPos, new DefaultHighlightPainter(Color.ORANGE)); } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } }