List of usage examples for javax.swing.text BadLocationException getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.jwebsocket.ui.TestDialog.java
private void mLog(String aMessage) { synchronized (txaLog) { try {/*from w w w . j a v a 2 s .c o m*/ int lMAX = 1000; int lLineCount = txaLog.getLineCount(); if (lLineCount > lMAX) { int lLinePosStart = txaLog.getLineEndOffset(0); int lLinePosEnd = txaLog.getLineEndOffset(lMAX); String lTextToReplace = txaLog.getText(lLinePosStart, txaLog.getText().length() - lLinePosStart); txaLog.replaceRange(lTextToReplace, 0, lLinePosEnd); } if (null != aMessage) { System.out.println(aMessage); } } catch (BadLocationException ex) { mLog(ex.getClass().getSimpleName() + ": " + ex.getMessage()); } } }