Class PTextComponent

PComponent
   |
   --PTextComponent
Classes extended from PTextComponent: PLabel, PTextArea, PTextField
Location: Program_Root/swing/PTextComponent.php
JTextComponent is the base class for swing text 
 components.  It tries to be compatible with the
 java.awt.TextComponent class
 where it can reasonably do so.  Also provided are other services
 for additional flexibility (beyond the pluggable UI and bean
 support).
 You can find information on how to use the functionality
 this class provides in
 General Rules for Using Text Components,
 a section in The Java Tutorial.

 
Caret Changes
The caret is a pluggable object in swing text components. Notification of changes to the caret position and the selection are sent to implementations of the CaretListener interface that have been registered with the text component. The UI will install a default caret unless a customized caret has been set.

Commands
Text components provide a number of commands that can be used to manipulate the component. This is essentially the way that the component expresses its capabilities. These are expressed in terms of the swing Action interface, using the TextAction implementation. The set of commands supported by the text component can be found with the <A HREF="../../../javax/swing/text/JTextComponent.html#getActions()"><CODE>getActions()</CODE></A> method. These actions can be bound to key events, fired from buttons, etc.

Text Input
The text components support flexible and internationalized text input, using keymaps and the input method framework, while maintaining compatibility with the AWT listener model.

A <A HREF="../../../javax/swing/text/Keymap.html"><CODE>Keymap</CODE></A> lets an application bind key strokes to actions. In order to allow keymaps to be shared across multiple text components, they can use actions that extend TextAction. TextAction can determine which JTextComponent most recently has or had focus and therefore is the subject of the action (In the case that the ActionEvent sent to the action doesn't contain the target text component as its source).

The input method framework lets text components interact with input methods, separate software components that preprocess events to let users enter thousands of different characters using keyboards with far fewer keys. JTextComponent is an active client of the framework, so it implements the preferred user interface for interacting with input methods. As a consequence, some key events do not reach the text component because they are handled by an input method, and some text input reaches the text component as committed text within an <A HREF="../../../java/awt/event/InputMethodEvent.html"><CODE>InputMethodEvent</CODE></A> instead of as a key event. The complete text input is the combination of the characters in keyTyped key events and committed text in input method events.

The AWT listener model lets applications attach event listeners to components in order to bind events to actions. Swing encourages the use of keymaps instead of listeners, but maintains compatibility with listeners by giving the listeners a chance to steal an event by consuming it.


Class Variable Summary


Inherited Class Variable Summary


Method Summary


Inherited Method Summary


Variable Detail


Method Detail