Example usage for javax.swing.text BadLocationException getClass

List of usage examples for javax.swing.text BadLocationException getClass

Introduction

In this page you can find the example usage for javax.swing.text BadLocationException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

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());
        }
    }
}