Example usage for javax.swing JEditorPane addCaretListener

List of usage examples for javax.swing JEditorPane addCaretListener

Introduction

In this page you can find the example usage for javax.swing JEditorPane addCaretListener.

Prototype

public void addCaretListener(CaretListener listener) 

Source Link

Document

Adds a caret listener for notification of any changes to the caret.

Usage

From source file:org.docx4all.swing.text.WordMLEditorKit.java

/**
 * Called when the kit is being installed into the a JEditorPane.
 * /*w  ww .  j  av  a2  s.c o  m*/
 * @param c
 *            the JEditorPane
 */
@Override
public void install(JEditorPane c) {
    super.install(c);

    c.addCaretListener(caretListener);
    c.addCaretListener(contentControlTracker);
    c.addMouseListener(mouseListener);
    c.addMouseMotionListener(mouseListener);
    c.addPropertyChangeListener(caretListener);
    caretListener.updateCaretElement(0, 0, c);

    initKeyBindings(c);
}