📄 defaultcaret.html
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#repaint()">repaint</A></B>()</CODE><BR> Cause the caret to be painted.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#setBlinkRate(int)">setBlinkRate</A></B>(int rate)</CODE><BR> Sets the caret blink rate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#setDot(int)">setDot</A></B>(int dot)</CODE><BR> Sets the caret position and mark to some position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#setMagicCaretPosition(java.awt.Point)">setMagicCaretPosition</A></B>(<A HREF="../../../java/awt/Point.html">Point</A> p)</CODE><BR> Saves the current caret position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#setSelectionVisible(boolean)">setSelectionVisible</A></B>(boolean vis)</CODE><BR> Changes the selection visibility.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#setVisible(boolean)">setVisible</A></B>(boolean e)</CODE><BR> Sets the caret visibility, and repaints the caret.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#toString()">toString</A></B>()</CODE><BR> Returns a <code>String</code> representing this <code>Rectangle</code> and its values.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.Rectangle"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.<A HREF="../../../java/awt/Rectangle.html">Rectangle</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/Rectangle.html#add(int, int)">add</A>, <A HREF="../../../java/awt/Rectangle.html#add(java.awt.Point)">add</A>, <A HREF="../../../java/awt/Rectangle.html#add(java.awt.Rectangle)">add</A>, <A HREF="../../../java/awt/Rectangle.html#contains(int, int)">contains</A>, <A HREF="../../../java/awt/Rectangle.html#contains(int, int, int, int)">contains</A>, <A HREF="../../../java/awt/Rectangle.html#contains(java.awt.Point)">contains</A>, <A HREF="../../../java/awt/Rectangle.html#contains(java.awt.Rectangle)">contains</A>, <A HREF="../../../java/awt/Rectangle.html#createIntersection(java.awt.geom.Rectangle2D)">createIntersection</A>, <A HREF="../../../java/awt/Rectangle.html#createUnion(java.awt.geom.Rectangle2D)">createUnion</A>, <A HREF="../../../java/awt/Rectangle.html#getBounds()">getBounds</A>, <A HREF="../../../java/awt/Rectangle.html#getBounds2D()">getBounds2D</A>, <A HREF="../../../java/awt/Rectangle.html#getHeight()">getHeight</A>, <A HREF="../../../java/awt/Rectangle.html#getLocation()">getLocation</A>, <A HREF="../../../java/awt/Rectangle.html#getSize()">getSize</A>, <A HREF="../../../java/awt/Rectangle.html#getWidth()">getWidth</A>, <A HREF="../../../java/awt/Rectangle.html#getX()">getX</A>, <A HREF="../../../java/awt/Rectangle.html#getY()">getY</A>, <A HREF="../../../java/awt/Rectangle.html#grow(int, int)">grow</A>, <A HREF="../../../java/awt/Rectangle.html#inside(int, int)">inside</A>, <A HREF="../../../java/awt/Rectangle.html#intersection(java.awt.Rectangle)">intersection</A>, <A HREF="../../../java/awt/Rectangle.html#intersects(java.awt.Rectangle)">intersects</A>, <A HREF="../../../java/awt/Rectangle.html#isEmpty()">isEmpty</A>, <A HREF="../../../java/awt/Rectangle.html#move(int, int)">move</A>, <A HREF="../../../java/awt/Rectangle.html#outcode(double, double)">outcode</A>, <A HREF="../../../java/awt/Rectangle.html#reshape(int, int, int, int)">reshape</A>, <A HREF="../../../java/awt/Rectangle.html#resize(int, int)">resize</A>, <A HREF="../../../java/awt/Rectangle.html#setBounds(int, int, int, int)">setBounds</A>, <A HREF="../../../java/awt/Rectangle.html#setBounds(java.awt.Rectangle)">setBounds</A>, <A HREF="../../../java/awt/Rectangle.html#setLocation(int, int)">setLocation</A>, <A HREF="../../../java/awt/Rectangle.html#setLocation(java.awt.Point)">setLocation</A>, <A HREF="../../../java/awt/Rectangle.html#setRect(double, double, double, double)">setRect</A>, <A HREF="../../../java/awt/Rectangle.html#setSize(java.awt.Dimension)">setSize</A>, <A HREF="../../../java/awt/Rectangle.html#setSize(int, int)">setSize</A>, <A HREF="../../../java/awt/Rectangle.html#translate(int, int)">translate</A>, <A HREF="../../../java/awt/Rectangle.html#union(java.awt.Rectangle)">union</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.geom.Rectangle2D"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.geom.<A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/geom/Rectangle2D.html#add(double, double)">add</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#add(java.awt.geom.Point2D)">add</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#add(java.awt.geom.Rectangle2D)">add</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#contains(double, double)">contains</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#contains(double, double, double, double)">contains</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#hashCode()">hashCode</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#intersect(java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D)">intersect</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#intersects(double, double, double, double)">intersects</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#intersectsLine(double, double, double, double)">intersectsLine</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#intersectsLine(java.awt.geom.Line2D)">intersectsLine</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#outcode(java.awt.geom.Point2D)">outcode</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#setFrame(double, double, double, double)">setFrame</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#setRect(java.awt.geom.Rectangle2D)">setRect</A>, <A HREF="../../../java/awt/geom/Rectangle2D.html#union(java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D, java.awt.geom.Rectangle2D)">union</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.geom.RectangularShape"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.geom.<A HREF="../../../java/awt/geom/RectangularShape.html">RectangularShape</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/geom/RectangularShape.html#clone()">clone</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#contains(java.awt.geom.Point2D)">contains</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#contains(java.awt.geom.Rectangle2D)">contains</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getCenterX()">getCenterX</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getCenterY()">getCenterY</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getFrame()">getFrame</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getMaxX()">getMaxX</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getMaxY()">getMaxY</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getMinX()">getMinX</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#getMinY()">getMinY</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#intersects(java.awt.geom.Rectangle2D)">intersects</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrame(java.awt.geom.Point2D, java.awt.geom.Dimension2D)">setFrame</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrame(java.awt.geom.Rectangle2D)">setFrame</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrameFromCenter(double, double, double, double)">setFrameFromCenter</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrameFromCenter(java.awt.geom.Point2D, java.awt.geom.Point2D)">setFrameFromCenter</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrameFromDiagonal(double, double, double, double)">setFrameFromDiagonal</A>, <A HREF="../../../java/awt/geom/RectangularShape.html#setFrameFromDiagonal(java.awt.geom.Point2D, java.awt.geom.Point2D)">setFrameFromDiagonal</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.Shape"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface java.awt.<A HREF="../../../java/awt/Shape.html">Shape</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/Shape.html#contains(double, double)">contains</A>, <A HREF="../../../java/awt/Shape.html#contains(double, double, double, double)">contains</A>, <A HREF="../../../java/awt/Shape.html#contains(java.awt.geom.Point2D)">contains</A>, <A HREF="../../../java/awt/Shape.html#contains(java.awt.geom.Rectangle2D)">contains</A>, <A HREF="../../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform)">getPathIterator</A>, <A HREF="../../../java/awt/Shape.html#getPathIterator(java.awt.geom.AffineTransform, double)">getPathIterator</A>, <A HREF="../../../java/awt/Shape.html#intersects(double, double, double, double)">intersects</A>, <A HREF="../../../java/awt/Shape.html#intersects(java.awt.geom.Rectangle2D)">intersects</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="listenerList"><!-- --></A><H3>listenerList</H3><PRE>protected <A HREF="../../../javax/swing/event/EventListenerList.html">EventListenerList</A> <B>listenerList</B></PRE><DL><DD>The event listener list.</DL><HR><A NAME="changeEvent"><!-- --></A><H3>changeEvent</H3><PRE>protected transient <A HREF="../../../javax/swing/event/ChangeEvent.html">ChangeEvent</A> <B>changeEvent</B></PRE><DL><DD>The change event for the model. Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DefaultCaret()"><!-- --></A><H3>DefaultCaret</H3><PRE>public <B>DefaultCaret</B>()</PRE><DL><DD>Constructs a default caret.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getComponent()"><!-- --></A><H3>getComponent</H3><PRE>protected final <A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> <B>getComponent</B>()</PRE><DL><DD>Gets the text editor component that this caret is is bound to.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the component</DL></DD></DL><HR><A NAME="repaint()"><!-- --></A><H3>repaint</H3><PRE>protected final void <B>repaint</B>()</PRE><DL><DD>Cause the caret to be painted. The repaint area is the bounding box of the caret (i.e. the caret rectangle or <em>this</em>). <p> This method is thread safe, although most Swing methods are not. Please see <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html"> Threads and Swing</A> for more information.<DD><DL></DL></DD></DL><HR><A NAME="damage(java.awt.Rectangle)"><!-- --></A><H3>damage</H3><PRE>protected void <B>damage</B>(<A HREF="../../../java/awt/Rectangle.html">Rectangle</A> r)</PRE><DL><DD>Damages the area surrounding the caret to cause it to be repainted in a new location. If paint() is reimplemented, this method should also be reimplemented. This method should update the caret bounds (x, y, width, and height).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the current location of the caret<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/DefaultCaret.html#paint(java.awt.Graphics)"><CODE>paint(java.awt.Graphics)</CODE></A></DL></DD></DL><HR><A NAME="adjustVisibility(java.awt.Rectangle)"><!-- --></A><H3>adjustVisibility</H3><PRE>protected void <B>adjustVisibility</B>(<A HREF="../../../java/awt/Rectangle.html">Rectangle</A> nloc)</PRE><DL><DD>Scrolls the associated view (if necessary) to make the caret visible. Since how this should be done is somewhat of a policy, this method can be reimplemented to change the behavior. By default the scrollRectToVisible method is called on the associated component.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nloc</CODE> - the new position to scroll to</DL></DD></DL><HR><A NAME="getSelectionPainter()"><!-- --></A><H3>getSelectionPainter</H3><PRE>protected <A HREF="../../../javax/swing/text/Highlighter.HighlightPainter.html">Highlighter.HighlightPainter</A> <B>getSelectionPainter</B>()</PRE><DL><DD>Gets the painter for the Highlighter.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the painter</DL></DD></DL><HR><A NAME="positionCaret(java.awt.event.MouseEvent)"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -