<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.TextComponent
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.TextArea.html#_top_">Previous</a>  <a href="java.awt.TextField.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.TextComponent
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.awt.Component.html#_top_">java.awt.Component</a>
           |
           +----java.awt.TextComponent
</pre>
<hr>
<dl>
  <dt> public class <b>TextComponent</b>
  <dt> extends <a href="java.awt.Component.html#_top_">Component</a>
</dl>
The <code>TextComponent</code> class is the superclass of 
 any component that allows the editing of some text. 
 <p>
 A text component embodies a string of text.  The 
 <code>TextComponent</code> class defines a set of methods 
 that determine whether or not this text is editable. If the
 component is editable, it defines another set of methods
 that supports a text insertion caret. 
 <p>
 In addition, the class defines methods that are used 
 to maintain a current <em>selection</em> from the text. 
 The text selection, a substring of the component's text, 
 is the target of editing operations. It is also referred
 to as the <em>selected text</em>.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#textListener"><b>textListener</b></a>
  <dd> 
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addTextListener(java.awt.event.TextListener)"><b>addTextListener</b></a>(TextListener)
  <dd>  Adds the specified text event listener to recieve text events 
 from this textcomponent.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getCaretPosition()"><b>getCaretPosition</b></a>()
  <dd>  Gets the position of the text insertion caret for 
 this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSelectedText()"><b>getSelectedText</b></a>()
  <dd>  Gets the selected text from the text that is
 presented by this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSelectionEnd()"><b>getSelectionEnd</b></a>()
  <dd>  Gets the end position of the selected text in 
 this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSelectionStart()"><b>getSelectionStart</b></a>()
  <dd>  Gets the start position of the selected text in 
 this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getText()"><b>getText</b></a>()
  <dd>  Gets the text that is presented by this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#isEditable()"><b>isEditable</b></a>()
  <dd>  Indicates whether or not this text component is editable.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#paramString()"><b>paramString</b></a>()
  <dd>  Returns the parameter string representing the state of this text 
 component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#processEvent(java.awt.AWTEvent)"><b>processEvent</b></a>(AWTEvent)
  <dd>  Processes events on this textcomponent.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#processTextEvent(java.awt.event.TextEvent)"><b>processTextEvent</b></a>(TextEvent)
  <dd> 
 Processes text events occurring on this text component by
 dispatching them to any registered TextListener objects.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeNotify()"><b>removeNotify</b></a>()
  <dd>  Removes the TextComponent's peer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeTextListener(java.awt.event.TextListener)"><b>removeTextListener</b></a>(TextListener)
  <dd>  Removes the specified text event listener so that it no longer
 receives text events from this textcomponent

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#select(int, int)"><b>select</b></a>(int, int)
  <dd>  Selects the text between the specified start and end positions.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#selectAll()"><b>selectAll</b></a>()
  <dd>  Selects all the text in this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setCaretPosition(int)"><b>setCaretPosition</b></a>(int)
  <dd>  Sets the position of the text insertion caret for 
 this text component.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setEditable(boolean)"><b>setEditable</b></a>(boolean)
  <dd>  Sets the flag that determines whether or not this
 text component is editable.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setSelectionEnd(int)"><b>setSelectionEnd</b></a>(int)
  <dd>  Sets the selection end for this text component to  
 the specified position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setSelectionStart(int)"><b>setSelectionStart</b></a>(int)
  <dd>  Sets the selection start for this text component to  
 the specified position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setText(java.lang.String)"><b>setText</b></a>(String)
  <dd>  Sets the text that is presented by this 
 text component to be the specified text.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="textListener"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>textListener</b>
<pre>
 protected transient <a href="java.awt.event.TextListener.html#_top_">TextListener</a> textListener
</pre>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="removeNotify()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeNotify"><b>removeNotify</b></a>
<pre>
 public void removeNotify()
</pre>
<dl>
  <dd> Removes the TextComponent's peer.  The peer allows us to modify
 the appearance of the TextComponent without changing its
 functionality.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#removeNotify()">removeNotify</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<a name="setText(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setText"><b>setText</b></a>
<pre>
 public synchronized void setText(<a href="java.lang.String.html#_top_">String</a> t)
</pre>
<dl>
  <dd> Sets the text that is presented by this 
 text component to be the specified text.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> t - the new text.
    <dt> <b>See Also:</b>
    <dd> <a href="#getText">getText</a>
  </dl></dd>
</dl>
<a name="getText()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getText"><b>getText</b></a>
<pre>
 public synchronized <a href="java.lang.String.html#_top_">String</a> getText()
</pre>
<dl>
  <dd> Gets the text that is presented by this text component.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#setText">setText</a>
  </dl></dd>
</dl>
<a name="getSelectedText()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSelectedText"><b>getSelectedText</b></a>
<pre>
 public synchronized <a href="java.lang.String.html#_top_">String</a> getSelectedText()
</pre>
<dl>
  <dd> Gets the selected text from the text that is
 presented by this text component.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the selected text of this text component.
    <dt> <b>See Also:</b>
    <dd> <a href="#select">select</a>
  </dl></dd>
</dl>
<a name="isEditable()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isEditable"><b>isEditable</b></a>
<pre>
 public boolean isEditable()
</pre>
<dl>
  <dd> Indicates whether or not this text component is editable.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if this text component is
                  editable; <code>false</code> otherwise.
    <dt> <b>See Also:</b>
    <dd> <a href="#setEditable">setEditable</a>
  </dl></dd>
</dl>
<a name="setEditable(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setEditable"><b>setEditable</b></a>
<pre>
 public synchronized void setEditable(boolean b)
</pre>
<dl>
  <dd> Sets the flag that determines whether or not this
 text component is editable.
 <p>
 If the flag is set to <code>true</code>, this text component 
 becomes user editable. If the flag is set to <code>false</code>, 
 the user cannot change the text of this text component.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> t - a flag indicating whether this text component
                      should be user editable.
    <dt> <b>See Also:</b>
    <dd> <a href="#isEditable">isEditable</a>
  </dl></dd>
</dl>
<a name="getSelectionStart()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSelectionStart"><b>getSelectionStart</b></a>
<pre>
 public synchronized int getSelectionStart()
</pre>
<dl>
  <dd> Gets the start position of the selected text in 
 this text component.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the start position of the selected text.
    <dt> <b>See Also:</b>
    <dd> <a href="#setSelectionStart">setSelectionStart</a>, <a href="#getSelectionEnd">getSelectionEnd</a>
  </dl></dd>
</dl>
<a name="setSelectionStart(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setSelectionStart"><b>setSelectionStart</b></a>
<pre>
 public synchronized void setSelectionStart(int selectionStart)
</pre>
<dl>
  <dd> Sets the selection start for this text component to  
 the specified position. The new start point is constrained 
 to be at or before the current selection end. It also
 cannot be set to less than zero, the beginning of the 
 component's text.
 If the caller supplies a value for <code>selectionStart</code>
 that is out of bounds, the method enforces these constraints
 silently, and without failure.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> selectionStart - the start position of the
                        selected text.
    <dt> <b>See Also:</b>
    <dd> <a href="#getSelectionStart">getSelectionStart</a>, <a href="#setSelectionEnd">setSelectionEnd</a>
  </dl></dd>
</dl>
<a name="getSelectionEnd()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSelectionEnd"><b>getSelectionEnd</b></a>
<pre>
 public synchronized int getSelectionEnd()
</pre>
<dl>
  <dd> Gets the end position of the selected text in 
 this text component.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the end position of the selected text.
    <dt> <b>See Also:</b>
    <dd> <a href="#setSelectionEnd">setSelectionEnd</a>, <a href="#getSelectionStart">getSelectionStart</a>
  </dl></dd>
</dl>
<a name="setSelectionEnd(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setSelectionEnd"><b>setSelectionEnd</b></a>
<pre>
 public synchronized void setSelectionEnd(int selectionEnd)
</pre>
<dl>
  <dd> Sets the selection end for this text component to  
 the specified position. The new end point is constrained 
 to be at or after the current selection start. It also
 cannot be set beyond the end of the component's text.
 If the caller supplies a value for <code>selectionEnd</code>
 that is out of bounds, the method enforces these constraints
 silently, and without failure.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> selectionEnd - the end position of the
                        selected text.
    <dt> <b>See Also:</b>
    <dd> <a href="#getSelectionEnd">getSelectionEnd</a>, <a href="#setSelectionStart">setSelectionStart</a>
  </dl></dd>
</dl>
<a name="select(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="select"><b>select</b></a>
<pre>
 public synchronized void select(int selectionStart,
                                 int selectionEnd)
</pre>
<dl>
  <dd> Selects the text between the specified start and end positions.
 <p>
 This method sets the start and end positions of the 
 selected text, enforcing the restriction that the end 
 position must be greater than or equal to the start position.
 The start position must be greater than zero, and the 
 end position must be less that or equal to the length
 of the text component's text. If the caller supplies values
 that are inconsistent or out of bounds, the method enforces 
 these constraints silently, and without failure.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> selectionStart - the start position of the
                             text to select.
    <dd> selectionEnd - the end position of the
                             text to select.
    <dt> <b>See Also:</b>
    <dd> <a href="#setSelectionStart">setSelectionStart</a>, <a href="#setSelectionEnd">setSelectionEnd</a>, <a href="#selectAll">selectAll</a>
  </dl></dd>
</dl>
<a name="selectAll()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="selectAll"><b>selectAll</b></a>
<pre>
 public synchronized void selectAll()
</pre>
<dl>
  <dd> Selects all the text in this text component.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> TextComponent@select
  </dl></dd>
</dl>
<a name="setCaretPosition(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setCaretPosition"><b>setCaretPosition</b></a>
<pre>
 public synchronized void setCaretPosition(int position)
</pre>
<dl>
  <dd> Sets the position of the text insertion caret for 
 this text component.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> position - the position of the text insertion caret.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the value supplied
                   for <code>position</code> is less than zero.
  </dl></dd>
</dl>
<a name="getCaretPosition()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getCaretPosition"><b>getCaretPosition</b></a>
<pre>
 public synchronized int getCaretPosition()
</pre>
<dl>
  <dd> Gets the position of the text insertion caret for 
 this text component.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the position of the text insertion caret.
  </dl></dd>
</dl>
<a name="addTextListener(java.awt.event.TextListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addTextListener"><b>addTextListener</b></a>
<pre>
 public synchronized void addTextListener(<a href="java.awt.event.TextListener.html#_top_">TextListener</a> l)
</pre>
<dl>
  <dd> Adds the specified text event listener to recieve text events 
 from this textcomponent.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> l - the text event listener
  </dl></dd>
</dl>
<a name="removeTextListener(java.awt.event.TextListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeTextListener"><b>removeTextListener</b></a>
<pre>
 public synchronized void removeTextListener(<a href="java.awt.event.TextListener.html#_top_">TextListener</a> l)
</pre>
<dl>
  <dd> Removes the specified text event listener so that it no longer
 receives text events from this textcomponent
<p>
</dl>
<a name="processEvent(java.awt.AWTEvent)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="processEvent"><b>processEvent</b></a>
<pre>
 protected void processEvent(<a href="java.awt.AWTEvent.html#_top_">AWTEvent</a> e)
</pre>
<dl>
  <dd> Processes events on this textcomponent. If the event is a
 TextEvent, it invokes the processTextEvent method,
 else it invokes its superclass's processEvent.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the event
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#processEvent(java.awt.AWTEvent)">processEvent</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<a name="processTextEvent(java.awt.event.TextEvent)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="processTextEvent"><b>processTextEvent</b></a>
<pre>
 protected void processTextEvent(<a href="java.awt.event.TextEvent.html#_top_">TextEvent</a> e)
</pre>
<dl>
  <dd> Processes text events occurring on this text component by
 dispatching them to any registered TextListener objects.
 NOTE: This method will not be called unless text events
 are enabled for this component; this happens when one of the
 following occurs:
 a) A TextListener object is registered via addTextListener()
 b) Text events are enabled via enableEvents()
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the text event
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Component.html#enableEvents">enableEvents</a>
  </dl></dd>
</dl>
<a name="paramString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="paramString"><b>paramString</b></a>
<pre>
 protected <a href="java.lang.String.html#_top_">String</a> paramString()
</pre>
<dl>
  <dd> Returns the parameter string representing the state of this text 
 component. This string is useful for debugging.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the parameter string of this text component.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#paramString()">paramString</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.TextArea.html#_top_">Previous</a>  <a href="java.awt.TextField.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
