📄 defaultcaret.html
字号:
<TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#adjustVisibility(java.awt.Rectangle)">adjustVisibility</A></B>(<A HREF="../../../java/awt/Rectangle.html">Rectangle</A> nloc)</CODE><BR> Scrolls the associated view (if necessary) to make the caret visible.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><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#damage(java.awt.Rectangle)">damage</A></B>(<A HREF="../../../java/awt/Rectangle.html">Rectangle</A> r)</CODE><BR> Damages the area surrounding the caret to cause it to be repainted in a new location.</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#deinstall(javax.swing.text.JTextComponent)">deinstall</A></B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c)</CODE><BR> Called when the UI is being removed from the interface of a JTextComponent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../../java/lang/Object.html">Object</A> obj)</CODE><BR> Compares this object to the specifed object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><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#fireStateChanged()">fireStateChanged</A></B>()</CODE><BR> Notifies all listeners that have registered interest for notification on this event type.</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#focusGained(java.awt.event.FocusEvent)">focusGained</A></B>(<A HREF="../../../java/awt/event/FocusEvent.html">FocusEvent</A> e)</CODE><BR> Called when the component containing the caret gains focus.</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#focusLost(java.awt.event.FocusEvent)">focusLost</A></B>(<A HREF="../../../java/awt/event/FocusEvent.html">FocusEvent</A> e)</CODE><BR> Called when the component containing the caret loses focus.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getBlinkRate()">getBlinkRate</A></B>()</CODE><BR> Gets the caret blink rate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getComponent()">getComponent</A></B>()</CODE><BR> Gets the text editor component that this caret is is bound to.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getDot()">getDot</A></B>()</CODE><BR> Fetches the current position of the caret.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/util/EventListener.html">EventListener</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getListeners(java.lang.Class)">getListeners</A></B>(<A HREF="../../../java/lang/Class.html">Class</A> listenerType)</CODE><BR> Return an array of all the listeners of the given type that were added to this model.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/Point.html">Point</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getMagicCaretPosition()">getMagicCaretPosition</A></B>()</CODE><BR> Gets the saved caret position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getMark()">getMark</A></B>()</CODE><BR> Fetches the current position of the mark.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../javax/swing/text/Highlighter.HighlightPainter.html">Highlighter.HighlightPainter</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#getSelectionPainter()">getSelectionPainter</A></B>()</CODE><BR> Gets the painter for the Highlighter.</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#install(javax.swing.text.JTextComponent)">install</A></B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c)</CODE><BR> Called when the UI is being installed into the interface of a JTextComponent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#isSelectionVisible()">isSelectionVisible</A></B>()</CODE><BR> Checks whether the current selection is visible.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/DefaultCaret.html#isVisible()">isVisible</A></B>()</CODE><BR> Determines if the caret is currently visible.</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#mouseClicked(java.awt.event.MouseEvent)">mouseClicked</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Called when the mouse is clicked.</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#mouseDragged(java.awt.event.MouseEvent)">mouseDragged</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Moves the caret position according to the mouse pointer's current location.</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#mouseEntered(java.awt.event.MouseEvent)">mouseEntered</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Called when the mouse enters a region.</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#mouseExited(java.awt.event.MouseEvent)">mouseExited</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Called when the mouse exits a region.</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#mouseMoved(java.awt.event.MouseEvent)">mouseMoved</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Called when the mouse is moved.</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#mousePressed(java.awt.event.MouseEvent)">mousePressed</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> If button 1 is pressed, this is implemented to request focus on the associated text component, and to set the 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#mouseReleased(java.awt.event.MouseEvent)">mouseReleased</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Called when the mouse is released.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><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#moveCaret(java.awt.event.MouseEvent)">moveCaret</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Tries to move the position of the caret from the coordinates of a mouse event, using viewToModel().</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#moveDot(int)">moveDot</A></B>(int dot)</CODE><BR> Moves the caret position to some other 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#paint(java.awt.Graphics)">paint</A></B>(<A HREF="../../../java/awt/Graphics.html">Graphics</A> g)</CODE><BR> Renders the caret as a vertical line.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><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#positionCaret(java.awt.event.MouseEvent)">positionCaret</A></B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A> e)</CODE><BR> Tries to set the position of the caret from the coordinates of a mouse event, using viewToModel().</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#removeChangeListener(javax.swing.event.ChangeListener)">removeChangeListener</A></B>(<A HREF="../../../javax/swing/event/ChangeListener.html">ChangeListener</A> l)</CODE><BR> Removes a listener that was tracking caret position changes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -