⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultcaret.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
positionCaret</H3><PRE>protected void <B>positionCaret</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Tries to set the position of the caret from the coordinates of a mouse event, using viewToModel().<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event</DL></DD></DL><HR><A NAME="moveCaret(java.awt.event.MouseEvent)"><!-- --></A><H3>moveCaret</H3><PRE>protected void <B>moveCaret</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Tries to move the position of the caret from the coordinates of a mouse event, using viewToModel().  This will cause a selection if the dot and mark are different.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event</DL></DD></DL><HR><A NAME="focusGained(java.awt.event.FocusEvent)"><!-- --></A><H3>focusGained</H3><PRE>public void <B>focusGained</B>(<A HREF="../../../java/awt/event/FocusEvent.html">FocusEvent</A>&nbsp;e)</PRE><DL><DD>Called when the component containing the caret gains focus.  This is implemented to set the caret to visible if the component is editable.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/FocusListener.html#focusGained(java.awt.event.FocusEvent)">focusGained</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/FocusListener.html">FocusListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the focus event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/FocusListener.html#focusGained(java.awt.event.FocusEvent)"><CODE>FocusListener.focusGained(java.awt.event.FocusEvent)</CODE></A></DL></DD></DL><HR><A NAME="focusLost(java.awt.event.FocusEvent)"><!-- --></A><H3>focusLost</H3><PRE>public void <B>focusLost</B>(<A HREF="../../../java/awt/event/FocusEvent.html">FocusEvent</A>&nbsp;e)</PRE><DL><DD>Called when the component containing the caret loses focus.  This is implemented to set the caret to visibility to false.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/FocusListener.html#focusLost(java.awt.event.FocusEvent)">focusLost</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/FocusListener.html">FocusListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the focus event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/FocusListener.html#focusLost(java.awt.event.FocusEvent)"><CODE>FocusListener.focusLost(java.awt.event.FocusEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseClicked(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseClicked</H3><PRE>public void <B>mouseClicked</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Called when the mouse is clicked.  If the click was generated from button1, a double click selects a word, and a triple click the current line.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseListener.html#mouseClicked(java.awt.event.MouseEvent)">mouseClicked</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseListener.html">MouseListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseListener.html#mouseClicked(java.awt.event.MouseEvent)"><CODE>MouseListener.mouseClicked(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mousePressed(java.awt.event.MouseEvent)"><!-- --></A><H3>mousePressed</H3><PRE>public void <B>mousePressed</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>If button 1 is pressed, this is implemented to request focus on the associated text component,  and to set the caret position. If the shift key is held down, the caret will be moved, potentially resulting in a selection, otherwise the caret position will be set to the new location.  If the component is not enabled, there will be no request for focus.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseListener.html#mousePressed(java.awt.event.MouseEvent)">mousePressed</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseListener.html">MouseListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseListener.html#mousePressed(java.awt.event.MouseEvent)"><CODE>MouseListener.mousePressed(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseReleased(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseReleased</H3><PRE>public void <B>mouseReleased</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Called when the mouse is released.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseListener.html#mouseReleased(java.awt.event.MouseEvent)">mouseReleased</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseListener.html">MouseListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseListener.html#mouseReleased(java.awt.event.MouseEvent)"><CODE>MouseListener.mouseReleased(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseEntered(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseEntered</H3><PRE>public void <B>mouseEntered</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Called when the mouse enters a region.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseListener.html#mouseEntered(java.awt.event.MouseEvent)">mouseEntered</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseListener.html">MouseListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseListener.html#mouseEntered(java.awt.event.MouseEvent)"><CODE>MouseListener.mouseEntered(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseExited(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseExited</H3><PRE>public void <B>mouseExited</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Called when the mouse exits a region.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseListener.html#mouseExited(java.awt.event.MouseEvent)">mouseExited</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseListener.html">MouseListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseListener.html#mouseExited(java.awt.event.MouseEvent)"><CODE>MouseListener.mouseExited(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseDragged(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseDragged</H3><PRE>public void <B>mouseDragged</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Moves the caret position  according to the mouse pointer's current location.  This effectively extends the selection.  By default, this is only done for mouse button 1.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseMotionListener.html#mouseDragged(java.awt.event.MouseEvent)">mouseDragged</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseMotionListener.html">MouseMotionListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseMotionListener.html#mouseDragged(java.awt.event.MouseEvent)"><CODE>MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="mouseMoved(java.awt.event.MouseEvent)"><!-- --></A><H3>mouseMoved</H3><PRE>public void <B>mouseMoved</B>(<A HREF="../../../java/awt/event/MouseEvent.html">MouseEvent</A>&nbsp;e)</PRE><DL><DD>Called when the mouse is moved.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/event/MouseMotionListener.html#mouseMoved(java.awt.event.MouseEvent)">mouseMoved</A></CODE> in interface <CODE><A HREF="../../../java/awt/event/MouseMotionListener.html">MouseMotionListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the mouse event<DT><B>See Also: </B><DD><A HREF="../../../java/awt/event/MouseMotionListener.html#mouseMoved(java.awt.event.MouseEvent)"><CODE>MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)</CODE></A></DL></DD></DL><HR><A NAME="paint(java.awt.Graphics)"><!-- --></A><H3>paint</H3><PRE>public void <B>paint</B>(<A HREF="../../../java/awt/Graphics.html">Graphics</A>&nbsp;g)</PRE><DL><DD>Renders the caret as a vertical line.  If this is reimplemented the damage method should also be reimplemented as it assumes the shape of the caret is a vertical line.  Sets the caret color to the value returned by getCaretColor(). <p> If there are multiple text directions present in the associated document, a flag indicating the caret bias will be rendered. This will occur only if the associated document is a subclass of AbstractDocument and there are multiple bidi levels present in the bidi element structure (i.e. the text has multiple directions associated with it).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Caret.html#paint(java.awt.Graphics)">paint</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Caret.html">Caret</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the graphics context<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/DefaultCaret.html#damage(java.awt.Rectangle)"><CODE>damage(java.awt.Rectangle)</CODE></A></DL></DD></DL><HR><A NAME="install(javax.swing.text.JTextComponent)"><!-- --></A><H3>install</H3><PRE>public void <B>install</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A>&nbsp;c)</PRE><DL><DD>Called when the UI is being installed into the interface of a JTextComponent.  This can be used to gain access to the model that is being navigated by the implementation of this interface.  Sets the dot and mark to 0, and establishes document, property change, focus, mouse, and mouse motion listeners.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Caret.html#install(javax.swing.text.JTextComponent)">install</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Caret.html">Caret</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the component<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Caret.html#install(javax.swing.text.JTextComponent)"><CODE>Caret.install(javax.swing.text.JTextComponent)</CODE></A></DL></DD></DL><HR><A NAME="deinstall(javax.swing.text.JTextComponent)"><!-- --></A><H3>deinstall</H3><PRE>public void <B>deinstall</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A>&nbsp;c)</PRE><DL><DD>Called when the UI is being removed from the interface of a JTextComponent.  This is used to unregister any listeners that were attached.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Caret.html#deinstall(javax.swing.text.JTextComponent)">deinstall</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Caret.html">Caret</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the component<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Caret.html#deinstall(javax.swing.text.JTextComponent)"><CODE>Caret.deinstall(javax.swing.text.JTextComponent)</CODE></A></DL></DD></DL><HR><A NAME="addChangeListener(javax.swing.event.ChangeListener)"><!-- --></A><H3>addChangeListener</H3><PRE>public void <B>addChangeListener</B>(<A HREF="../../../javax/swing/event/ChangeListener.html">ChangeListener</A>&nbsp;l)</PRE><DL><DD>Adds a listener to track whenever the caret position has been changed.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Caret.html#addChangeListener(javax.swing.event.ChangeListener)">addChangeListener</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Caret.html">Caret</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Caret.html#addChangeListener(javax.swing.event.ChangeListener)"><CODE>Caret.addChangeListener(javax.swing.event.ChangeListener)</CODE></A></DL></DD></DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -