lib
Class CurrentLineHighlighter
java.lang.Object
lib.CurrentLineHighlighter
public class CurrentLineHighlighter
- extends java.lang.Object
This class can be used to highlight the current line for any JTextComponent.
- Version:
- 1.0
- Author:
- Santhosh Kumar T, Peter De Bruycker
Method Summary |
private static void |
caretUpdate(javax.swing.text.JTextComponent c)
Fetches the previous caret location, stores the current caret location,
If the caret is on another line, repaint the previous line and the current line |
static void |
install(javax.swing.text.JTextComponent c)
|
static void |
uninstall(javax.swing.text.JTextComponent c)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LINE_HIGHLIGHT
private static final java.lang.String LINE_HIGHLIGHT
- See Also:
- Constant Field Values
PREVIOUS_CARET
private static final java.lang.String PREVIOUS_CARET
- See Also:
- Constant Field Values
col
private static java.awt.Color col
caretListener
private static javax.swing.event.CaretListener caretListener
mouseListener
private static java.awt.event.MouseListener mouseListener
mouseMotionListener
private static java.awt.event.MouseMotionListener mouseMotionListener
painter
private static javax.swing.text.Highlighter.HighlightPainter painter
CurrentLineHighlighter
public CurrentLineHighlighter()
install
public static void install(javax.swing.text.JTextComponent c)
uninstall
public static void uninstall(javax.swing.text.JTextComponent c)
caretUpdate
private static void caretUpdate(javax.swing.text.JTextComponent c)
- Fetches the previous caret location, stores the current caret location,
If the caret is on another line, repaint the previous line and the current line
- Parameters:
c
- the text component