Carets represent the location where new text is inserted.
Caret interface provides
a number of useful features for dealing with text insertion and
Caret interface defines
the properties shown in Table
property specifies the number of milliseconds between
Caret blinks. A value of
0 indicates that the
Caret shouldn’t blink at all.
Table 21-1. Caret properties
dot property is the current
Caret position as an offset into the
Document model. The
mark is the other end of the current
selection. If there is no selection, the value of
mark is the same as
selectionVisible property designates whether the current selection (if
any) should be decorated by the component’s
indicates whether the
itself should be visible. This is almost always
true when the
Caret’s text component is editable and has
focus but may not be in other situations.
when moving among lines with uneven end positions to ensure that the
up and down arrow keys produce the desired effect. For example,
consider the following text:
Line 1 is long Line 2 Line 3 is long
If the caret was initially positioned before the
long in line 3, you’d expect the up arrow key to move the caret to the end of line 2. A second up ...