Class CaretMonitor

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.CaretListener

    public class CaretMonitor
    extends java.lang.Object
    implements javax.swing.event.CaretListener
    This class can be used to display the caret location in friendly manner for an EditorPane.
    • Constructor Detail

      • CaretMonitor

        public CaretMonitor​(javax.swing.text.JTextComponent text,
                            javax.swing.JLabel label)
    • Method Detail

      • caretUpdate

        public void caretUpdate​(javax.swing.event.CaretEvent evt)
        Specified by:
        caretUpdate in interface javax.swing.event.CaretListener
      • updateLabel

        protected void updateLabel​(int pos)
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getNoSelectionFormat

        public java.lang.String getNoSelectionFormat()
      • setNoSelectionFormat

        public void setNoSelectionFormat​(java.lang.String noSelectionFormat)
      • getSelectionFormat

        public java.lang.String getSelectionFormat()
      • setSelectionFormat

        public void setSelectionFormat​(java.lang.String selectionFormat)