📄 jtextcomponent.accessiblejtextcomponent.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</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#toString()">toString</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> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= 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="JTextComponent.AccessibleJTextComponent(javax.swing.text.JTextComponent)"><!-- --></A><H3>JTextComponent.AccessibleJTextComponent</H3><PRE>public <B>JTextComponent.AccessibleJTextComponent</B>()</PRE><DL><DD>Constructs an AccessibleJTextComponent. Adds a listener to track caret change.</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="caretUpdate(javax.swing.event.CaretEvent)"><!-- --></A><H3>caretUpdate</H3><PRE>public void <B>caretUpdate</B>(<A HREF="../../../javax/swing/event/CaretEvent.html">CaretEvent</A> e)</PRE><DL><DD>Handles caret updates (fire appropriate property change event, which are AccessibleContext.ACCESSIBLE_CARET_PROPERTY and AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY). This keeps track of the dot position internally. When the caret moves, the internal position is updated after firing the event.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/event/CaretListener.html#caretUpdate(javax.swing.event.CaretEvent)">caretUpdate</A></CODE> in interface <CODE><A HREF="../../../javax/swing/event/CaretListener.html">CaretListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the CaretEvent</DL></DD></DL><HR><A NAME="insertUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>insertUpdate</H3><PRE>public void <B>insertUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Handles document insert (fire appropriate property change event which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/event/DocumentListener.html#insertUpdate(javax.swing.event.DocumentEvent)">insertUpdate</A></CODE> in interface <CODE><A HREF="../../../javax/swing/event/DocumentListener.html">DocumentListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the DocumentEvent</DL></DD></DL><HR><A NAME="removeUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>removeUpdate</H3><PRE>public void <B>removeUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Handles document remove (fire appropriate property change event, which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/event/DocumentListener.html#removeUpdate(javax.swing.event.DocumentEvent)">removeUpdate</A></CODE> in interface <CODE><A HREF="../../../javax/swing/event/DocumentListener.html">DocumentListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the DocumentEvent</DL></DD></DL><HR><A NAME="changedUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>changedUpdate</H3><PRE>public void <B>changedUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Handles document remove (fire appropriate property change event, which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/event/DocumentListener.html#changedUpdate(javax.swing.event.DocumentEvent)">changedUpdate</A></CODE> in interface <CODE><A HREF="../../../javax/swing/event/DocumentListener.html">DocumentListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the DocumentEvent</DL></DD></DL><HR><A NAME="getAccessibleStateSet()"><!-- --></A><H3>getAccessibleStateSet</H3><PRE>public <A HREF="../../../javax/accessibility/AccessibleStateSet.html">AccessibleStateSet</A> <B>getAccessibleStateSet</B>()</PRE><DL><DD>Gets the state set of the JTextComponent. The AccessibleStateSet of an object is composed of a set of unique AccessibleState's. A change in the AccessibleStateSet of an object will cause a PropertyChangeEvent to be fired for the AccessibleContext.ACCESSIBLE_STATE_PROPERTY property.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/JComponent.AccessibleJComponent.html#getAccessibleStateSet()">getAccessibleStateSet</A></CODE> in class <CODE><A HREF="../../../javax/swing/JComponent.AccessibleJComponent.html">JComponent.AccessibleJComponent</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an instance of AccessibleStateSet containing the current state set of the object<DT><B>See Also: </B><DD><A HREF="../../../javax/accessibility/AccessibleStateSet.html"><CODE>AccessibleStateSet</CODE></A>, <A HREF="../../../javax/accessibility/AccessibleState.html"><CODE>AccessibleState</CODE></A>, <A HREF="../../../javax/swing/JComponent.html#addPropertyChangeListener(java.beans.PropertyChangeListener)"><CODE>JComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)</CODE></A></DL></DD></DL><HR><A NAME="getAccessibleRole()"><!-- --></A><H3>getAccessibleRole</H3><PRE>public <A HREF="../../../javax/accessibility/AccessibleRole.html">AccessibleRole</A> <B>getAccessibleRole</B>()</PRE><DL><DD>Gets the role of this object.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/JComponent.AccessibleJComponent.html#getAccessibleRole()">getAccessibleRole</A></CODE> in class <CODE><A HREF="../../../javax/swing/JComponent.AccessibleJComponent.html">JComponent.AccessibleJComponent</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an instance of AccessibleRole describing the role of the object (AccessibleRole.TEXT)<DT><B>See Also: </B><DD><A HREF="../../../javax/accessibility/AccessibleRole.html"><CODE>AccessibleRole</CODE></A></DL></DD></DL><HR><A NAME="getAccessibleText()"><!-- --></A><H3>getAccessibleText</H3><PRE>public <A HREF="../../../javax/accessibility/AccessibleText.html">AccessibleText</A> <B>getAccessibleText</B>()</PRE><DL><DD>Get the AccessibleText associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleText interface on behalf of itself.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/accessibility/AccessibleContext.html#getAccessibleText()">getAccessibleText</A></CODE> in class <CODE><A HREF="../../../javax/accessibility/AccessibleContext.html">AccessibleContext</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>this object</DL></DD></DL><HR><A NAME="getIndexAtPoint(java.awt.Point)"><!-- --></A><H3>getIndexAtPoint</H3><PRE>public int <B>getIndexAtPoint</B>(<A HREF="../../../java/awt/Point.html">Point</A> p)</PRE><DL><DD>Given a point in local coordinates, return the zero-based index of the character under that Point. If the point is invalid, this method returns -1.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/accessibility/AccessibleText.html#getIndexAtPoint(java.awt.Point)">getIndexAtPoint</A></CODE> in interface <CODE><A HREF="../../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - the Point in local coordinates<DT><B>Returns:</B><DD>the zero-based index of the character under Point p.</DL></DD></DL><HR><A NAME="getCharacterBounds(int)"><!-- --></A><H3>getCharacterBounds</H3><PRE>public <A HREF="../../../java/awt/Rectangle.html">Rectangle</A> <B>getCharacterBounds</B>(int i)</PRE><DL><DD>Determines the bounding box of the character at the given index into the string. The bounds are returned in local coordinates. If the index is invalid a null rectangle is returned. Note: the JTextComponent must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful (non-null) value.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/accessibility/AccessibleText.html#getCharacterBounds(int)">getCharacterBounds</A></CODE> in interface <CODE><A HREF="../../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>i</CODE> - the index into the String >= 0<DT><B>Returns:</B><DD>the screen coordinates of the character's bounding box</DL></DD></DL><HR><A NAME="getCharCount()"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -