类java.awt.peer.TextComponentPeer源码实例Demo

下面列出了怎么用java.awt.peer.TextComponentPeer的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: jdk-1.7-annotated   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码2 项目: Bytecoder   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码3 项目: jdk1.8-source-analysis   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码4 项目: dragonwell8_jdk   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码5 项目: jdk8u_jdk   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码6 项目: Bytecoder   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the {@code TextComponent} contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an {@code IllegalArgumentException}
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if {@code position}
 *               is less than zero
 * @since        1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码7 项目: jdk8u-jdk   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码8 项目: Java8CN   文件: TextComponent.java
/**
 * Returns the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the text or caret have not been set, the default
 * caret position is 0.
 *
 * @return       the position of the text insertion caret
 * @see #setCaretPosition(int)
 * @since        JDK1.1
 */
public synchronized int getCaretPosition() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    int position = 0;

    if (peer != null) {
        position = peer.getCaretPosition();
    } else {
        position = selectionStart;
    }
    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }
    return position;
}
 
源代码9 项目: jdk8u60   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码10 项目: jdk8u60   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码11 项目: Java8CN   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码12 项目: jdk8u-jdk   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码13 项目: jdk8u-dev-jdk   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码14 项目: JDKSourceCode1.8   文件: TextComponent.java
/**
 * Returns the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the text or caret have not been set, the default
 * caret position is 0.
 *
 * @return       the position of the text insertion caret
 * @see #setCaretPosition(int)
 * @since        JDK1.1
 */
public synchronized int getCaretPosition() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    int position = 0;

    if (peer != null) {
        position = peer.getCaretPosition();
    } else {
        position = selectionStart;
    }
    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }
    return position;
}
 
源代码15 项目: JDKSourceCode1.8   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码16 项目: jdk8u_jdk   文件: TextComponent.java
/**
 * Returns the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the text or caret have not been set, the default
 * caret position is 0.
 *
 * @return       the position of the text insertion caret
 * @see #setCaretPosition(int)
 * @since        JDK1.1
 */
public synchronized int getCaretPosition() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    int position = 0;

    if (peer != null) {
        position = peer.getCaretPosition();
    } else {
        position = selectionStart;
    }
    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }
    return position;
}
 
源代码17 项目: hottub   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码18 项目: jdk8u-dev-jdk   文件: TextComponent.java
/**
 * Sets the position of the text insertion caret.
 * The caret position is constrained to be between 0
 * and the last character of the text, inclusive.
 * If the passed-in value is greater than this range,
 * the value is set to the last character (or 0 if
 * the <code>TextComponent</code> contains no text)
 * and no error is returned.  If the passed-in value is
 * less than 0, an <code>IllegalArgumentException</code>
 * is thrown.
 *
 * @param        position the position of the text insertion caret
 * @exception    IllegalArgumentException if <code>position</code>
 *               is less than zero
 * @since        JDK1.1
 */
public synchronized void setCaretPosition(int position) {
    if (position < 0) {
        throw new IllegalArgumentException("position less than zero.");
    }

    int maxposition = getText().length();
    if (position > maxposition) {
        position = maxposition;
    }

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.setCaretPosition(position);
    } else {
        select(position, position);
    }
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: TextComponent.java
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable TextListener(s) as optional data.
 * The non-serializable TextListener(s) are detected and
 * no attempt is made to serialize them.
 *
 * @serialData Null terminated sequence of zero or more pairs.
 *             A pair consists of a String and Object.
 *             The String indicates the type of object and
 *             is one of the following :
 *             textListenerK indicating and TextListener object.
 *
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#textListenerK
 */
private void writeObject(java.io.ObjectOutputStream s)
  throws IOException
{
    // Serialization support.  Since the value of the fields
    // selectionStart, selectionEnd, and text aren't necessarily
    // up to date, we sync them up with the peer before serializing.
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
        selectionStart = peer.getSelectionStart();
        selectionEnd = peer.getSelectionEnd();
    }

    s.defaultWriteObject();

    AWTEventMulticaster.save(s, textListenerK, textListener);
    s.writeObject(null);
}
 
源代码20 项目: jdk1.8-source-analysis   文件: TextComponent.java
/**
 * Returns the text that is presented by this text component.
 * By default, this is an empty string.
 *
 * @return the value of this <code>TextComponent</code>
 * @see     java.awt.TextComponent#setText
 */
public synchronized String getText() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
    }
    return text;
}
 
源代码21 项目: Java8CN   文件: TextComponent.java
/**
 * Removes the <code>TextComponent</code>'s peer.
 * The peer allows us to modify the appearance of the
 * <code>TextComponent</code> without changing its
 * functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }
        super.removeNotify();
    }
}
 
源代码22 项目: openjdk-8   文件: TextComponent.java
/**
 * Returns the text that is presented by this text component.
 * By default, this is an empty string.
 *
 * @return the value of this <code>TextComponent</code>
 * @see     java.awt.TextComponent#setText
 */
public synchronized String getText() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
    }
    return text;
}
 
源代码23 项目: dragonwell8_jdk   文件: TextComponent.java
/**
 * Removes the <code>TextComponent</code>'s peer.
 * The peer allows us to modify the appearance of the
 * <code>TextComponent</code> without changing its
 * functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }
        super.removeNotify();
    }
}
 
源代码24 项目: dragonwell8_jdk   文件: TextComponent.java
/**
 * Sets the text that is presented by this
 * text component to be the specified text.
 * @param       t   the new text;
 *                  if this parameter is <code>null</code> then
 *                  the text is set to the empty string ""
 * @see         java.awt.TextComponent#getText
 */
public synchronized void setText(String t) {
    boolean skipTextEvent = (text == null || text.isEmpty())
            && (t == null || t.isEmpty());
    text = (t != null) ? t : "";
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    // Please note that we do not want to post an event
    // if TextArea.setText() or TextField.setText() replaces an empty text
    // by an empty text, that is, if component's text remains unchanged.
    if (peer != null && !skipTextEvent) {
        peer.setText(text);
    }
}
 
源代码25 项目: openjdk-8-source   文件: TextComponent.java
/**
 * Gets the end position of the selected text in
 * this text component.
 * @return      the end position of the selected text
 * @see         java.awt.TextComponent#setSelectionEnd
 * @see         java.awt.TextComponent#getSelectionStart
 */
public synchronized int getSelectionEnd() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        selectionEnd = peer.getSelectionEnd();
    }
    return selectionEnd;
}
 
源代码26 项目: Bytecoder   文件: TextComponent.java
/**
 * Removes the {@code TextComponent}'s peer.
 * The peer allows us to modify the appearance of the
 * {@code TextComponent} without changing its
 * functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }
        super.removeNotify();
    }
}
 
源代码27 项目: jdk-1.7-annotated   文件: TextComponent.java
/**
 * Selects all the text in this text component.
 * @see        java.awt.TextComponent#select
 */
public synchronized void selectAll() {
    this.selectionStart = 0;
    this.selectionEnd = getText().length();

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.select(selectionStart, selectionEnd);
    }
}
 
源代码28 项目: Bytecoder   文件: TextComponent.java
/**
 * Returns the text that is presented by this text component.
 * By default, this is an empty string.
 *
 * @return the value of this {@code TextComponent}
 * @see     java.awt.TextComponent#setText
 */
public synchronized String getText() {
    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        text = peer.getText();
    }
    return text;
}
 
源代码29 项目: dragonwell8_jdk   文件: TextComponent.java
/**
 * Selects all the text in this text component.
 * @see        java.awt.TextComponent#select
 */
public synchronized void selectAll() {
    this.selectionStart = 0;
    this.selectionEnd = getText().length();

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.select(selectionStart, selectionEnd);
    }
}
 
源代码30 项目: jdk8u_jdk   文件: TextComponent.java
/**
 * Selects all the text in this text component.
 * @see        java.awt.TextComponent#select
 */
public synchronized void selectAll() {
    this.selectionStart = 0;
    this.selectionEnd = getText().length();

    TextComponentPeer peer = (TextComponentPeer)this.peer;
    if (peer != null) {
        peer.select(selectionStart, selectionEnd);
    }
}
 
 类所在包
 同包方法