javax.swing.text
Class JTextComponent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.text.JTextComponent
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible , Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Direct Known Subclasses:
JEditorPane sample code for javax.swing.JEditorPane definition code for javax.swing.JEditorPane , JTextArea sample code for javax.swing.JTextArea definition code for javax.swing.JTextArea , JTextField sample code for javax.swing.JTextField definition code for javax.swing.JTextField

public abstract class JTextComponent
extends JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
implements Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

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.
By default the caret tracks all the document changes performed on the Event Dispatching Thread and updates it's position accordingly if an insertion occurs before or at the caret position or a removal occurs before the caret position. DefaultCaret tries to make itself visible which may lead to scrolling of a text component within JScrollPane. The default caret behavior can be changed by the DefaultCaret.setUpdatePolicy(int) sample code for javax.swing.text.DefaultCaret.setUpdatePolicy(int) definition code for javax.swing.text.DefaultCaret.setUpdatePolicy(int) method.
Note: Non-editable text components also have a caret though it may not be painted.

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 getActions() sample code for javax.swing.text.JTextComponent.getActions() definition code for javax.swing.text.JTextComponent.getActions() 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 Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap 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 InputMethodEvent sample code for java.awt.event.InputMethodEvent definition code for java.awt.event.InputMethodEvent 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.

Keyboard event and input method events are handled in the following stages, with each stage capable of consuming the event:

Stage

KeyEvent

InputMethodEvent

1. input methods (generated here)
2. focus manager
3. registered key listeners registered input method listeners
4. input method handling in JTextComponent
5. keymap handling using the current keymap
6. keyboard handling in JComponent (e.g. accelerators, component navigation, etc.)

To maintain compatibility with applications that listen to key events but are not aware of input method events, the input method handling in stage 4 provides a compatibility mode for components that do not process input method events. For these components, the committed text is converted to keyTyped key events and processed in the key event pipeline starting at stage 3 instead of in the input method event pipeline.

By default the component will create a keymap (named DEFAULT_KEYMAP) that is shared by all JTextComponent instances as the default keymap. Typically a look-and-feel implementation will install a different keymap that resolves to the default keymap for those bindings not found in the different keymap. The minimal bindings include:

Model/View Split
The text components have a model-view split. A text component pulls together the objects used to represent the model, view, and controller. The text document model may be shared by other views which act as observers of the model (e.g. a document may be shared by multiple components).

Diagram showing interaction between Controller, Document, events, and ViewFactory

The model is defined by the Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document interface. This is intended to provide a flexible text storage mechanism that tracks change during edits and can be extended to more sophisticated models. The model interfaces are meant to capture the capabilities of expression given by SGML, a system used to express a wide variety of content. Each modification to the document causes notification of the details of the change to be sent to all observers in the form of a DocumentEvent sample code for javax.swing.event.DocumentEvent definition code for javax.swing.event.DocumentEvent which allows the views to stay up to date with the model. This event is sent to observers that have implemented the DocumentListener sample code for javax.swing.event.DocumentListener definition code for javax.swing.event.DocumentListener interface and registered interest with the model being observed.

Location Information
The capability of determining the location of text in the view is provided. There are two methods, modelToView(int) sample code for javax.swing.text.JTextComponent.modelToView(int) definition code for javax.swing.text.JTextComponent.modelToView(int) and viewToModel(java.awt.Point) sample code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) definition code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) for determining this information.

Undo/Redo support
Support for an edit history mechanism is provided to allow undo/redo operations. The text component does not itself provide the history buffer by default, but does provide the UndoableEdit records that can be used in conjunction with a history buffer to provide the undo/redo support. The support is provided by the Document model, which allows one to attach UndoableEditListener implementations.

Thread Safety
The swing text components provide some support of thread safe operations. Because of the high level of configurability of the text components, it is possible to circumvent the protection provided. The protection primarily comes from the model, so the documentation of AbstractDocument describes the assumptions of the protection provided. The methods that are safe to call asynchronously are marked with comments.

Newlines
For a discussion on how newlines are handled, see DefaultEditorKit.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document , DocumentEvent sample code for javax.swing.event.DocumentEvent definition code for javax.swing.event.DocumentEvent , DocumentListener sample code for javax.swing.event.DocumentListener definition code for javax.swing.event.DocumentListener , Caret sample code for javax.swing.text.Caret definition code for javax.swing.text.Caret , CaretEvent sample code for javax.swing.event.CaretEvent definition code for javax.swing.event.CaretEvent , CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener , TextUI sample code for javax.swing.plaf.TextUI definition code for javax.swing.plaf.TextUI , View sample code for javax.swing.text.View definition code for javax.swing.text.View , ViewFactory sample code for javax.swing.text.ViewFactory definition code for javax.swing.text.ViewFactory , Serialized Form

Nested Class Summary
 class JTextComponent.AccessibleJTextComponent sample code for javax.swing.text.JTextComponent.AccessibleJTextComponent definition code for javax.swing.text.JTextComponent.AccessibleJTextComponent
          This class implements accessibility support for the JTextComponent class.
static class JTextComponent.KeyBinding sample code for javax.swing.text.JTextComponent.KeyBinding definition code for javax.swing.text.JTextComponent.KeyBinding
          Binding record for creating key bindings.
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
static String sample code for java.lang.String definition code for java.lang.String DEFAULT_KEYMAP sample code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP definition code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP
          The default keymap that will be shared by all JTextComponent instances unless they have had a different keymap set.
static String sample code for java.lang.String definition code for java.lang.String FOCUS_ACCELERATOR_KEY sample code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY definition code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY
          The bound property name for the focus accelerator.
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JTextComponent sample code for javax.swing.text.JTextComponent.JTextComponent() definition code for javax.swing.text.JTextComponent.JTextComponent() ()
          Creates a new JTextComponent.
 
Method Summary
 void addCaretListener sample code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) (CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener  listener)
          Adds a caret listener for notification of any changes to the caret.
 void addInputMethodListener sample code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener) definition code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener) (InputMethodListener sample code for java.awt.event.InputMethodListener definition code for java.awt.event.InputMethodListener  l)
          Adds the specified input method listener to receive input method events from this component.
static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap addKeymap sample code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap) (String sample code for java.lang.String definition code for java.lang.String  nm, Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  parent)
          Adds a new keymap into the keymap hierarchy.
 void copy sample code for javax.swing.text.JTextComponent.copy() definition code for javax.swing.text.JTextComponent.copy() ()
          Transfers the currently selected range in the associated text model to the system clipboard, leaving the contents in the text model.
 void cut sample code for javax.swing.text.JTextComponent.cut() definition code for javax.swing.text.JTextComponent.cut() ()
          Transfers the currently selected range in the associated text model to the system clipboard, removing the contents from the model.
protected  void fireCaretUpdate sample code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent) definition code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent) (CaretEvent sample code for javax.swing.event.CaretEvent definition code for javax.swing.event.CaretEvent  e)
          Notifies all listeners that have registered interest for notification on this event type.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.text.JTextComponent.getAccessibleContext() definition code for javax.swing.text.JTextComponent.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JTextComponent.
 Action sample code for javax.swing.Action definition code for javax.swing.Action [] getActions sample code for javax.swing.text.JTextComponent.getActions() definition code for javax.swing.text.JTextComponent.getActions() ()
          Fetches the command list for the editor.
 Caret sample code for javax.swing.text.Caret definition code for javax.swing.text.Caret getCaret sample code for javax.swing.text.JTextComponent.getCaret() definition code for javax.swing.text.JTextComponent.getCaret() ()
          Fetches the caret that allows text-oriented navigation over the view.
 Color sample code for java.awt.Color definition code for java.awt.Color getCaretColor sample code for javax.swing.text.JTextComponent.getCaretColor() definition code for javax.swing.text.JTextComponent.getCaretColor() ()
          Fetches the current color used to render the caret.
 CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener [] getCaretListeners sample code for javax.swing.text.JTextComponent.getCaretListeners() definition code for javax.swing.text.JTextComponent.getCaretListeners() ()
          Returns an array of all the caret listeners registered on this text component.
 int getCaretPosition sample code for javax.swing.text.JTextComponent.getCaretPosition() definition code for javax.swing.text.JTextComponent.getCaretPosition() ()
          Returns the position of the text insertion caret for the text component.
 Color sample code for java.awt.Color definition code for java.awt.Color getDisabledTextColor sample code for javax.swing.text.JTextComponent.getDisabledTextColor() definition code for javax.swing.text.JTextComponent.getDisabledTextColor() ()
          Fetches the current color used to render the selected text.
 Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document getDocument sample code for javax.swing.text.JTextComponent.getDocument() definition code for javax.swing.text.JTextComponent.getDocument() ()
          Fetches the model associated with the editor.
 boolean getDragEnabled sample code for javax.swing.text.JTextComponent.getDragEnabled() definition code for javax.swing.text.JTextComponent.getDragEnabled() ()
          Gets the dragEnabled property.
 char getFocusAccelerator sample code for javax.swing.text.JTextComponent.getFocusAccelerator() definition code for javax.swing.text.JTextComponent.getFocusAccelerator() ()
          Returns the key accelerator that will cause the receiving text component to get the focus.
 Highlighter sample code for javax.swing.text.Highlighter definition code for javax.swing.text.Highlighter getHighlighter sample code for javax.swing.text.JTextComponent.getHighlighter() definition code for javax.swing.text.JTextComponent.getHighlighter() ()
          Fetches the object responsible for making highlights.
 InputMethodRequests sample code for java.awt.im.InputMethodRequests definition code for java.awt.im.InputMethodRequests getInputMethodRequests sample code for javax.swing.text.JTextComponent.getInputMethodRequests() definition code for javax.swing.text.JTextComponent.getInputMethodRequests() ()
          Gets the input method request handler which supports requests from input methods for this component.
 Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap getKeymap sample code for javax.swing.text.JTextComponent.getKeymap() definition code for javax.swing.text.JTextComponent.getKeymap() ()
          Fetches the keymap currently active in this text component.
static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap getKeymap sample code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nm)
          Fetches a named keymap previously added to the document.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getMargin sample code for javax.swing.text.JTextComponent.getMargin() definition code for javax.swing.text.JTextComponent.getMargin() ()
          Returns the margin between the text component's border and its text.
 NavigationFilter sample code for javax.swing.text.NavigationFilter definition code for javax.swing.text.NavigationFilter getNavigationFilter sample code for javax.swing.text.JTextComponent.getNavigationFilter() definition code for javax.swing.text.JTextComponent.getNavigationFilter() ()
          Returns the NavigationFilter.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredScrollableViewportSize sample code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize() definition code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize() ()
          Returns the preferred size of the viewport for a view component.
 int getScrollableBlockIncrement sample code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation.
 boolean getScrollableTracksViewportHeight sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight() ()
          Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport.
 boolean getScrollableTracksViewportWidth sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth() ()
          Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
 int getScrollableUnitIncrement sample code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation.
 String sample code for java.lang.String definition code for java.lang.String getSelectedText sample code for javax.swing.text.JTextComponent.getSelectedText() definition code for javax.swing.text.JTextComponent.getSelectedText() ()
          Returns the selected text contained in this TextComponent.
 Color sample code for java.awt.Color definition code for java.awt.Color getSelectedTextColor sample code for javax.swing.text.JTextComponent.getSelectedTextColor() definition code for javax.swing.text.JTextComponent.getSelectedTextColor() ()
          Fetches the current color used to render the selected text.
 Color sample code for java.awt.Color definition code for java.awt.Color getSelectionColor sample code for javax.swing.text.JTextComponent.getSelectionColor() definition code for javax.swing.text.JTextComponent.getSelectionColor() ()
          Fetches the current color used to render the selection.
 int getSelectionEnd sample code for javax.swing.text.JTextComponent.getSelectionEnd() definition code for javax.swing.text.JTextComponent.getSelectionEnd() ()
          Returns the selected text's end position.
 int getSelectionStart sample code for javax.swing.text.JTextComponent.getSelectionStart() definition code for javax.swing.text.JTextComponent.getSelectionStart() ()
          Returns the selected text's start position.
 String sample code for java.lang.String definition code for java.lang.String getText sample code for javax.swing.text.JTextComponent.getText() definition code for javax.swing.text.JTextComponent.getText() ()
          Returns the text contained in this TextComponent.
 String sample code for java.lang.String definition code for java.lang.String getText sample code for javax.swing.text.JTextComponent.getText(int, int) definition code for javax.swing.text.JTextComponent.getText(int, int) (int offs, int len)
          Fetches a portion of the text represented by the component.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Returns the string to be used as the tooltip for event.
 TextUI sample code for javax.swing.plaf.TextUI definition code for javax.swing.plaf.TextUI getUI sample code for javax.swing.text.JTextComponent.getUI() definition code for javax.swing.text.JTextComponent.getUI() ()
          Fetches the user-interface factory for this text-oriented editor.
 boolean isEditable sample code for javax.swing.text.JTextComponent.isEditable() definition code for javax.swing.text.JTextComponent.isEditable() ()
          Returns the boolean indicating whether this TextComponent is editable or not.
static void loadKeymap sample code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]) definition code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]) (Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  map, JTextComponent.KeyBinding sample code for javax.swing.text.JTextComponent.KeyBinding definition code for javax.swing.text.JTextComponent.KeyBinding [] bindings, Action sample code for javax.swing.Action definition code for javax.swing.Action [] actions)
           Loads a keymap with a bunch of bindings.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle modelToView sample code for javax.swing.text.JTextComponent.modelToView(int) definition code for javax.swing.text.JTextComponent.modelToView(int) (int pos)
          Converts the given location in the model to a place in the view coordinate system.
 void moveCaretPosition sample code for javax.swing.text.JTextComponent.moveCaretPosition(int) definition code for javax.swing.text.JTextComponent.moveCaretPosition(int) (int pos)
          Moves the caret to a new position, leaving behind a mark defined by the last time setCaretPosition was called.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.text.JTextComponent.paramString() definition code for javax.swing.text.JTextComponent.paramString() ()
          Returns a string representation of this JTextComponent.
 void paste sample code for javax.swing.text.JTextComponent.paste() definition code for javax.swing.text.JTextComponent.paste() ()
          Transfers the contents of the system clipboard into the associated text model.
protected  void processInputMethodEvent sample code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent) (InputMethodEvent sample code for java.awt.event.InputMethodEvent definition code for java.awt.event.InputMethodEvent  e)
          Processes input method events occurring on this component by dispatching them to any registered InputMethodListener objects.
 void read sample code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) definition code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) (Reader sample code for java.io.Reader definition code for java.io.Reader  in, Object sample code for java.lang.Object definition code for java.lang.Object  desc)
          Initializes from a stream.
 void removeCaretListener sample code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) (CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener  listener)
          Removes a caret listener.
static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap removeKeymap sample code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  nm)
          Removes a named keymap previously added to the document.
 void removeNotify sample code for javax.swing.text.JTextComponent.removeNotify() definition code for javax.swing.text.JTextComponent.removeNotify() ()
          Notifies this component that it no longer has a parent component.
 void replaceSelection sample code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) definition code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  content)
          Replaces the currently selected content with new content represented by the given string.
 void select sample code for javax.swing.text.JTextComponent.select(int, int) definition code for javax.swing.text.JTextComponent.select(int, int) (int selectionStart, int selectionEnd)
          Selects the text between the specified start and end positions.
 void selectAll sample code for javax.swing.text.JTextComponent.selectAll() definition code for javax.swing.text.JTextComponent.selectAll() ()
          Selects all the text in the TextComponent.
 void setCaret sample code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret) definition code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret) (Caret sample code for javax.swing.text.Caret definition code for javax.swing.text.Caret  c)
          Sets the caret to be used.
 void setCaretColor sample code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  c)
          Sets the current color used to render the caret.
 void setCaretPosition sample code for javax.swing.text.JTextComponent.setCaretPosition(int) definition code for javax.swing.text.JTextComponent.setCaretPosition(int) (int position)
          Sets the position of the text insertion caret for the TextComponent.
 void setComponentOrientation sample code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation) definition code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation) (ComponentOrientation sample code for java.awt.ComponentOrientation definition code for java.awt.ComponentOrientation  o)
          Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
 void setDisabledTextColor sample code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  c)
          Sets the current color used to render the disabled text.
 void setDocument sample code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) definition code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) (Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc)
          Associates the editor with a text document.
 void setDragEnabled sample code for javax.swing.text.JTextComponent.setDragEnabled(boolean) definition code for javax.swing.text.JTextComponent.setDragEnabled(boolean) (boolean b)
          Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
 void setEditable sample code for javax.swing.text.JTextComponent.setEditable(boolean) definition code for javax.swing.text.JTextComponent.setEditable(boolean) (boolean b)
          Sets the specified boolean to indicate whether or not this TextComponent should be editable.
 void setFocusAccelerator sample code for javax.swing.text.JTextComponent.setFocusAccelerator(char) definition code for javax.swing.text.JTextComponent.setFocusAccelerator(char) (char aKey)
          Sets the key accelerator that will cause the receiving text component to get the focus.
 void setHighlighter sample code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter) definition code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter) (Highlighter sample code for javax.swing.text.Highlighter definition code for javax.swing.text.Highlighter  h)
          Sets the highlighter to be used.
 void setKeymap sample code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap) (Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  map)
          Sets the keymap to use for binding events to actions.
 void setMargin sample code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets) definition code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  m)
          Sets margin space between the text component's border and its text.
 void setNavigationFilter sample code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter) definition code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter) (NavigationFilter sample code for javax.swing.text.NavigationFilter definition code for javax.swing.text.NavigationFilter  filter)
          Sets the NavigationFilter.
 void setSelectedTextColor sample code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  c)
          Sets the current color used to render the selected text.
 void setSelectionColor sample code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  c)
          Sets the current color used to render the selection.
 void setSelectionEnd sample code for javax.swing.text.JTextComponent.setSelectionEnd(int) definition code for javax.swing.text.JTextComponent.setSelectionEnd(int) (int selectionEnd)
          Sets the selection end to the specified position.
 void setSelectionStart sample code for javax.swing.text.JTextComponent.setSelectionStart(int) definition code for javax.swing.text.JTextComponent.setSelectionStart(int) (int selectionStart)
          Sets the selection start to the specified position.
 void setText sample code for javax.swing.text.JTextComponent.setText(java.lang.String) definition code for javax.swing.text.JTextComponent.setText(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  t)
          Sets the text of this TextComponent to the specified text.
 void setUI sample code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI) definition code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI) (TextUI sample code for javax.swing.plaf.TextUI definition code for javax.swing.plaf.TextUI  ui)
          Sets the user-interface factory for this text-oriented editor.
 void updateUI sample code for javax.swing.text.JTextComponent.updateUI() definition code for javax.swing.text.JTextComponent.updateUI() ()
          Reloads the pluggable UI.
 int viewToModel sample code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) definition code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  pt)
          Converts the given place in the view coordinate system to the nearest representative location in the model.
 void write sample code for javax.swing.text.JTextComponent.write(java.io.Writer) definition code for javax.swing.text.JTextComponent.write(java.io.Writer) (Writer sample code for java.io.Writer definition code for java.io.Writer  out)
          Stores the contents of the model into the given stream.
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() , getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) , getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() , getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) , getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() , getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() , getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() , getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() , getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) , getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() , getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) , getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) , getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) , getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) , getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() , getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() , getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() , getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) , getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) , getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() , getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() , getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() , getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() , getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() , getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() , getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() , getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() , getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() , grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() , isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() , isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) , isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() , isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() , isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() , isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() , isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() , isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) , print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) , printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) , printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) , processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) , processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) , putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) , removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) , repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) , repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) , requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) , resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() , reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) , revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) , setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) , setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) , setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) , setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) , setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) , setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) , setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) , setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) , setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) , setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) , setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) , setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) , unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) , update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

FOCUS_ACCELERATOR_KEY sample code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY

public static final String sample code for java.lang.String definition code for java.lang.String  FOCUS_ACCELERATOR_KEY
The bound property name for the focus accelerator.

See Also:
Constant Field Values

DEFAULT_KEYMAP sample code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP

public static final String sample code for java.lang.String definition code for java.lang.String  DEFAULT_KEYMAP
The default keymap that will be shared by all JTextComponent instances unless they have had a different keymap set.

See Also:
Constant Field Values
Constructor Detail

JTextComponent sample code for javax.swing.text.JTextComponent() definition code for javax.swing.text.JTextComponent()

public JTextComponent()
Creates a new JTextComponent. Listeners for caret events are established, and the pluggable UI installed. The component is marked as editable. No layout manager is used, because layout is managed by the view subsystem of text. The document model is set to null.

Method Detail

getUI sample code for javax.swing.text.JTextComponent.getUI() definition code for javax.swing.text.JTextComponent.getUI()

public TextUI sample code for javax.swing.plaf.TextUI definition code for javax.swing.plaf.TextUI  getUI()
Fetches the user-interface factory for this text-oriented editor.

Returns:
the factory

setUI sample code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI) definition code for javax.swing.text.JTextComponent.setUI(javax.swing.plaf.TextUI)

public void setUI(TextUI sample code for javax.swing.plaf.TextUI definition code for javax.swing.plaf.TextUI  ui)
Sets the user-interface factory for this text-oriented editor.

Parameters:
ui - the factory

updateUI sample code for javax.swing.text.JTextComponent.updateUI() definition code for javax.swing.text.JTextComponent.updateUI()

public void updateUI()
Reloads the pluggable UI. The key used to fetch the new interface is getUIClassID(). The type of the UI is TextUI. invalidate is called after setting the UI.

Overrides:
updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI) sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , UIManager.getLookAndFeel() sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel() , UIManager.getUI(javax.swing.JComponent) sample code for javax.swing.UIManager.getUI(javax.swing.JComponent) definition code for javax.swing.UIManager.getUI(javax.swing.JComponent)

addCaretListener sample code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener)

public void addCaretListener(CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener  listener)
Adds a caret listener for notification of any changes to the caret.

Parameters:
listener - the listener to be added
See Also:
CaretEvent sample code for javax.swing.event.CaretEvent definition code for javax.swing.event.CaretEvent

removeCaretListener sample code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener)

public void removeCaretListener(CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener  listener)
Removes a caret listener.

Parameters:
listener - the listener to be removed
See Also:
CaretEvent sample code for javax.swing.event.CaretEvent definition code for javax.swing.event.CaretEvent

getCaretListeners sample code for javax.swing.text.JTextComponent.getCaretListeners() definition code for javax.swing.text.JTextComponent.getCaretListeners()

public CaretListener sample code for javax.swing.event.CaretListener definition code for javax.swing.event.CaretListener [] getCaretListeners()
Returns an array of all the caret listeners registered on this text component.

Returns:
all of this component's CaretListeners or an empty array if no caret listeners are currently registered
Since:
1.4
See Also:
addCaretListener(javax.swing.event.CaretListener) sample code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.addCaretListener(javax.swing.event.CaretListener) , removeCaretListener(javax.swing.event.CaretListener) sample code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener) definition code for javax.swing.text.JTextComponent.removeCaretListener(javax.swing.event.CaretListener)

fireCaretUpdate sample code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent) definition code for javax.swing.text.JTextComponent.fireCaretUpdate(javax.swing.event.CaretEvent)

protected void fireCaretUpdate(CaretEvent sample code for javax.swing.event.CaretEvent definition code for javax.swing.event.CaretEvent  e)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in a last-to-first manner.

Parameters:
e - the event
See Also:
EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList

setDocument sample code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) definition code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document)

public void setDocument(Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc)
Associates the editor with a text document. The currently registered factory is used to build a view for the document, which gets displayed by the editor after revalidation. A PropertyChange event ("document") is propagated to each listener.

Parameters:
doc - the document to display/edit
See Also:
getDocument() sample code for javax.swing.text.JTextComponent.getDocument() definition code for javax.swing.text.JTextComponent.getDocument()

getDocument sample code for javax.swing.text.JTextComponent.getDocument() definition code for javax.swing.text.JTextComponent.getDocument()

public Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  getDocument()
Fetches the model associated with the editor. This is primarily for the UI to get at the minimal amount of state required to be a text editor. Subclasses will return the actual type of the model which will typically be something that extends Document.

Returns:
the model

setComponentOrientation sample code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation) definition code for javax.swing.text.JTextComponent.setComponentOrientation(java.awt.ComponentOrientation)

public void setComponentOrientation(ComponentOrientation sample code for java.awt.ComponentOrientation definition code for java.awt.ComponentOrientation  o)
Description copied from class: Component sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation)
Sets the language-sensitive orientation that is to be used to order the elements or text within this component. Language-sensitive LayoutManager and Component subclasses will use this property to determine how to lay out and draw components.

At construction time, a component's orientation is set to ComponentOrientation.UNKNOWN, indicating that it has not been specified explicitly. The UNKNOWN orientation behaves the same as ComponentOrientation.LEFT_TO_RIGHT.

To set the orientation of a single component, use this method. To set the orientation of an entire component hierarchy, use applyComponentOrientation sample code for java.awt.Component.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.applyComponentOrientation(java.awt.ComponentOrientation) .

Overrides:
setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) in class Component sample code for java.awt.Component definition code for java.awt.Component
See Also:
ComponentOrientation sample code for java.awt.ComponentOrientation definition code for java.awt.ComponentOrientation

getActions sample code for javax.swing.text.JTextComponent.getActions() definition code for javax.swing.text.JTextComponent.getActions()

public Action sample code for javax.swing.Action definition code for javax.swing.Action [] getActions()
Fetches the command list for the editor. This is the list of commands supported by the plugged-in UI augmented by the collection of commands that the editor itself supports. These are useful for binding to events, such as in a keymap.

Returns:
the command list

setMargin sample code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets) definition code for javax.swing.text.JTextComponent.setMargin(java.awt.Insets)

public void setMargin(Insets sample code for java.awt.Insets definition code for java.awt.Insets  m)
Sets margin space between the text component's border and its text. The text component's default Border object will use this value to create the proper margin. However, if a non-default border is set on the text component, it is that Border object's responsibility to create the appropriate margin space (else this property will effectively be ignored). This causes a redraw of the component. A PropertyChange event ("margin") is sent to all listeners.

Parameters:
m - the space between the border and the text

getMargin sample code for javax.swing.text.JTextComponent.getMargin() definition code for javax.swing.text.JTextComponent.getMargin()

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getMargin()
Returns the margin between the text component's border and its text.

Returns:
the margin

setNavigationFilter sample code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter) definition code for javax.swing.text.JTextComponent.setNavigationFilter(javax.swing.text.NavigationFilter)

public void setNavigationFilter(NavigationFilter sample code for javax.swing.text.NavigationFilter definition code for javax.swing.text.NavigationFilter  filter)
Sets the NavigationFilter. NavigationFilter is used by DefaultCaret and the default cursor movement actions as a way to restrict the cursor movement.

Since:
1.4

getNavigationFilter sample code for javax.swing.text.JTextComponent.getNavigationFilter() definition code for javax.swing.text.JTextComponent.getNavigationFilter()

public NavigationFilter sample code for javax.swing.text.NavigationFilter definition code for javax.swing.text.NavigationFilter  getNavigationFilter()
Returns the NavigationFilter. NavigationFilter is used by DefaultCaret and the default cursor movement actions as a way to restrict the cursor movement. A null return value implies the cursor movement and selection should not be restricted.

Returns:
the NavigationFilter
Since:
1.4

getCaret sample code for javax.swing.text.JTextComponent.getCaret() definition code for javax.swing.text.JTextComponent.getCaret()

public Caret sample code for javax.swing.text.Caret definition code for javax.swing.text.Caret  getCaret()
Fetches the caret that allows text-oriented navigation over the view.

Returns:
the caret

setCaret sample code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret) definition code for javax.swing.text.JTextComponent.setCaret(javax.swing.text.Caret)

public void setCaret(Caret sample code for javax.swing.text.Caret definition code for javax.swing.text.Caret  c)
Sets the caret to be used. By default this will be set by the UI that gets installed. This can be changed to a custom caret if desired. Setting the caret results in a PropertyChange event ("caret") being fired.

Parameters:
c - the caret
See Also:
getCaret() sample code for javax.swing.text.JTextComponent.getCaret() definition code for javax.swing.text.JTextComponent.getCaret()

getHighlighter sample code for javax.swing.text.JTextComponent.getHighlighter() definition code for javax.swing.text.JTextComponent.getHighlighter()

public Highlighter sample code for javax.swing.text.Highlighter definition code for javax.swing.text.Highlighter  getHighlighter()
Fetches the object responsible for making highlights.

Returns:
the highlighter

setHighlighter sample code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter) definition code for javax.swing.text.JTextComponent.setHighlighter(javax.swing.text.Highlighter)

public void setHighlighter(Highlighter sample code for javax.swing.text.Highlighter definition code for javax.swing.text.Highlighter  h)
Sets the highlighter to be used. By default this will be set by the UI that gets installed. This can be changed to a custom highlighter if desired. The highlighter can be set to null to disable it. A PropertyChange event ("highlighter") is fired when a new highlighter is installed.

Parameters:
h - the highlighter
See Also:
getHighlighter() sample code for javax.swing.text.JTextComponent.getHighlighter() definition code for javax.swing.text.JTextComponent.getHighlighter()

setKeymap sample code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.setKeymap(javax.swing.text.Keymap)

public void setKeymap(Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  map)
Sets the keymap to use for binding events to actions. Setting to null effectively disables keyboard input. A PropertyChange event ("keymap") is fired when a new keymap is installed.

Parameters:
map - the keymap
See Also:
getKeymap() sample code for javax.swing.text.JTextComponent.getKeymap() definition code for javax.swing.text.JTextComponent.getKeymap()

setDragEnabled sample code for javax.swing.text.JTextComponent.setDragEnabled(boolean) definition code for javax.swing.text.JTextComponent.setDragEnabled(boolean)

public void setDragEnabled(boolean b)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component. The transferHandler property needs to be set to a non-null value for the drag to do anything. The default value of the dragEnabled property is false.

When automatic drag handling is enabled, most look and feels begin a drag-and-drop operation whenever the user presses the mouse button over a selection and then moves the mouse a few pixels. Setting this property to true can therefore have a subtle effect on how selections behave.

Some look and feels might not support automatic drag and drop; they will ignore this property. You can work around such look and feels by modifying the component to directly call the exportAsDrag method of a TransferHandler.

Parameters:
b - the value to set the dragEnabled property to
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if b is true and GraphicsEnvironment.isHeadless() returns true
Since:
1.4
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless() , getDragEnabled() sample code for javax.swing.text.JTextComponent.getDragEnabled() definition code for javax.swing.text.JTextComponent.getDragEnabled() , JComponent.setTransferHandler(javax.swing.TransferHandler) sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler

getDragEnabled sample code for javax.swing.text.JTextComponent.getDragEnabled() definition code for javax.swing.text.JTextComponent.getDragEnabled()

public boolean getDragEnabled()
Gets the dragEnabled property.

Returns:
the value of the dragEnabled property
Since:
1.4
See Also:
setDragEnabled(boolean) sample code for javax.swing.text.JTextComponent.setDragEnabled(boolean) definition code for javax.swing.text.JTextComponent.setDragEnabled(boolean)

getKeymap sample code for javax.swing.text.JTextComponent.getKeymap() definition code for javax.swing.text.JTextComponent.getKeymap()

public Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  getKeymap()
Fetches the keymap currently active in this text component.

Returns:
the keymap

addKeymap sample code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap) definition code for javax.swing.text.JTextComponent.addKeymap(java.lang.String, javax.swing.text.Keymap)

public static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  addKeymap(String sample code for java.lang.String definition code for java.lang.String  nm,
                               Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  parent)
Adds a new keymap into the keymap hierarchy. Keymap bindings resolve from bottom up so an attribute specified in a child will override an attribute specified in the parent.

Parameters:
nm - the name of the keymap (must be unique within the collection of named keymaps in the document); the name may be null if the keymap is unnamed, but the caller is responsible for managing the reference returned as an unnamed keymap can't be fetched by name
parent - the parent keymap; this may be null if unspecified bindings need not be resolved in some other keymap
Returns:
the keymap

removeKeymap sample code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.removeKeymap(java.lang.String)

public static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  removeKeymap(String sample code for java.lang.String definition code for java.lang.String  nm)
Removes a named keymap previously added to the document. Keymaps with null names may not be removed in this way.

Parameters:
nm - the name of the keymap to remove
Returns:
the keymap that was removed

getKeymap sample code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.getKeymap(java.lang.String)

public static Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  getKeymap(String sample code for java.lang.String definition code for java.lang.String  nm)
Fetches a named keymap previously added to the document. This does not work with null-named keymaps.

Parameters:
nm - the name of the keymap
Returns:
the keymap

loadKeymap sample code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]) definition code for javax.swing.text.JTextComponent.loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[])

public static void loadKeymap(Keymap sample code for javax.swing.text.Keymap definition code for javax.swing.text.Keymap  map,
                              JTextComponent.KeyBinding sample code for javax.swing.text.JTextComponent.KeyBinding definition code for javax.swing.text.JTextComponent.KeyBinding [] bindings,
                              Action sample code for javax.swing.Action definition code for javax.swing.Action [] actions)

Loads a keymap with a bunch of bindings. This can be used to take a static table of definitions and load them into some keymap. The following example illustrates an example of binding some keys to the cut, copy, and paste actions associated with a JTextComponent. A code fragment to accomplish this might look as follows:



   static final JTextComponent.KeyBinding[] defaultBindings = {
     new JTextComponent.KeyBinding(
       KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
       DefaultEditorKit.copyAction),
     new JTextComponent.KeyBinding(
       KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
       DefaultEditorKit.pasteAction),
     new JTextComponent.KeyBinding(
       KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK),
       DefaultEditorKit.cutAction),
   };

   JTextComponent c = new JTextPane();
   Keymap k = c.getKeymap();
   JTextComponent.loadKeymap(k, defaultBindings, c.getActions());
 
 
The sets of bindings and actions may be empty but must be non-null.

Parameters:
map - the keymap
bindings - the bindings
actions - the set of actions

getCaretColor sample code for javax.swing.text.JTextComponent.getCaretColor() definition code for javax.swing.text.JTextComponent.getCaretColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getCaretColor()
Fetches the current color used to render the caret.

Returns:
the color

setCaretColor sample code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setCaretColor(java.awt.Color)

public void setCaretColor(Color sample code for java.awt.Color definition code for java.awt.Color  c)
Sets the current color used to render the caret. Setting to null effectively restores the default color. Setting the color results in a PropertyChange event ("caretColor") being fired.

Parameters:
c - the color
See Also:
getCaretColor() sample code for javax.swing.text.JTextComponent.getCaretColor() definition code for javax.swing.text.JTextComponent.getCaretColor()

getSelectionColor sample code for javax.swing.text.JTextComponent.getSelectionColor() definition code for javax.swing.text.JTextComponent.getSelectionColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getSelectionColor()
Fetches the current color used to render the selection.

Returns:
the color

setSelectionColor sample code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectionColor(java.awt.Color)

public void setSelectionColor(Color sample code for java.awt.Color definition code for java.awt.Color  c)
Sets the current color used to render the selection. Setting the color to null is the same as setting Color.white. Setting the color results in a PropertyChange event ("selectionColor").

Parameters:
c - the color
See Also:
getSelectionColor() sample code for javax.swing.text.JTextComponent.getSelectionColor() definition code for javax.swing.text.JTextComponent.getSelectionColor()

getSelectedTextColor sample code for javax.swing.text.JTextComponent.getSelectedTextColor() definition code for javax.swing.text.JTextComponent.getSelectedTextColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getSelectedTextColor()
Fetches the current color used to render the selected text.

Returns:
the color

setSelectedTextColor sample code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setSelectedTextColor(java.awt.Color)

public void setSelectedTextColor(Color sample code for java.awt.Color definition code for java.awt.Color  c)
Sets the current color used to render the selected text. Setting the color to null is the same as Color.black. Setting the color results in a PropertyChange event ("selectedTextColor") being fired.

Parameters:
c - the color
See Also:
getSelectedTextColor() sample code for javax.swing.text.JTextComponent.getSelectedTextColor() definition code for javax.swing.text.JTextComponent.getSelectedTextColor()

getDisabledTextColor sample code for javax.swing.text.JTextComponent.getDisabledTextColor() definition code for javax.swing.text.JTextComponent.getDisabledTextColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getDisabledTextColor()
Fetches the current color used to render the selected text.

Returns:
the color

setDisabledTextColor sample code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color) definition code for javax.swing.text.JTextComponent.setDisabledTextColor(java.awt.Color)

public void setDisabledTextColor(Color sample code for java.awt.Color definition code for java.awt.Color  c)
Sets the current color used to render the disabled text. Setting the color fires off a PropertyChange event ("disabledTextColor").

Parameters:
c - the color
See Also:
getDisabledTextColor() sample code for javax.swing.text.JTextComponent.getDisabledTextColor() definition code for javax.swing.text.JTextComponent.getDisabledTextColor()

replaceSelection sample code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) definition code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String)

public void replaceSelection(String sample code for java.lang.String definition code for java.lang.String  content)
Replaces the currently selected content with new content represented by the given string. If there is no selection this amounts to an insert of the given text. If there is no replacement text this amounts to a removal of the current selection.

This is the method that is used by the default implementation of the action for inserting content that gets bound to the keymap actions.

This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.

Parameters:
content - the content to replace the selection with

getText sample code for javax.swing.text.JTextComponent.getText(int, int) definition code for javax.swing.text.JTextComponent.getText(int, int)

public String sample code for java.lang.String definition code for java.lang.String  getText(int offs,
                      int len)
               throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Fetches a portion of the text represented by the component. Returns an empty string if length is 0.

Parameters:
offs - the offset >= 0
len - the length >= 0
Returns:
the text
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if the offset or length are invalid

modelToView sample code for javax.swing.text.JTextComponent.modelToView(int) definition code for javax.swing.text.JTextComponent.modelToView(int)

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  modelToView(int pos)
                      throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized). The component does not have to be visible or painted.

Parameters:
pos - the position >= 0
Returns:
the coordinates as a rectangle, with (r.x, r.y) as the location in the coordinate system, or null if the component does not yet have a positive size.
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if the given position does not represent a valid location in the associated document
See Also:
TextUI.modelToView(javax.swing.text.JTextComponent, int) sample code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int) definition code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int)

viewToModel sample code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point) definition code for javax.swing.text.JTextComponent.viewToModel(java.awt.Point)

public int viewToModel(Point sample code for java.awt.Point definition code for java.awt.Point  pt)
Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized). The component does not have to be visible or painted.

Parameters:
pt - the location in the view to translate
Returns:
the offset >= 0 from the start of the document, or -1 if the component does not yet have a positive size.
See Also:
TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point) sample code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point)

cut sample code for javax.swing.text.JTextComponent.cut() definition code for javax.swing.text.JTextComponent.cut()

public void cut()
Transfers the currently selected range in the associated text model to the system clipboard, removing the contents from the model. The current selection is reset. Does nothing for null selections.

See Also:
Toolkit.getSystemClipboard() sample code for java.awt.Toolkit.getSystemClipboard() definition code for java.awt.Toolkit.getSystemClipboard() , Clipboard sample code for java.awt.datatransfer.Clipboard definition code for java.awt.datatransfer.Clipboard

copy sample code for javax.swing.text.JTextComponent.copy() definition code for javax.swing.text.JTextComponent.copy()

public void copy()
Transfers the currently selected range in the associated text model to the system clipboard, leaving the contents in the text model. The current selection remains intact. Does nothing for null selections.

See Also:
Toolkit.getSystemClipboard() sample code for java.awt.Toolkit.getSystemClipboard() definition code for java.awt.Toolkit.getSystemClipboard() , Clipboard sample code for java.awt.datatransfer.Clipboard definition code for java.awt.datatransfer.Clipboard

paste sample code for javax.swing.text.JTextComponent.paste() definition code for javax.swing.text.JTextComponent.paste()

public void paste()
Transfers the contents of the system clipboard into the associated text model. If there is a selection in the associated view, it is replaced with the contents of the clipboard. If there is no selection, the clipboard contents are inserted in front of the current insert position in the associated view. If the clipboard is empty, does nothing.

See Also:
replaceSelection(java.lang.String) sample code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) definition code for javax.swing.text.JTextComponent.replaceSelection(java.lang.String) , Toolkit.getSystemClipboard() sample code for java.awt.Toolkit.getSystemClipboard() definition code for java.awt.Toolkit.getSystemClipboard() , Clipboard sample code for java.awt.datatransfer.Clipboard definition code for java.awt.datatransfer.Clipboard

moveCaretPosition sample code for javax.swing.text.JTextComponent.moveCaretPosition(int) definition code for javax.swing.text.JTextComponent.moveCaretPosition(int)

public void moveCaretPosition(int pos)
Moves the caret to a new position, leaving behind a mark defined by the last time setCaretPosition was called. This forms a selection. If the document is null, does nothing. The position must be between 0 and the length of the component's text or else an exception is thrown.

Parameters:
pos - the position
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the value supplied for position is less than zero or greater than the component's text length
See Also:
setCaretPosition(int) sample code for javax.swing.text.JTextComponent.setCaretPosition(int) definition code for javax.swing.text.JTextComponent.setCaretPosition(int)

setFocusAccelerator sample code for javax.swing.text.JTextComponent.setFocusAccelerator(char) definition code for javax.swing.text.JTextComponent.setFocusAccelerator(char)

public void setFocusAccelerator(char aKey)
Sets the key accelerator that will cause the receiving text component to get the focus. The accelerator will be the key combination of the alt key and the character given (converted to upper case). By default, there is no focus accelerator key. Any previous key accelerator setting will be superseded. A '\0' key setting will be registered, and has the effect of turning off the focus accelerator. When the new key is set, a PropertyChange event (FOCUS_ACCELERATOR_KEY) will be fired.

Parameters:
aKey - the key
See Also:
getFocusAccelerator() sample code for javax.swing.text.JTextComponent.getFocusAccelerator() definition code for javax.swing.text.JTextComponent.getFocusAccelerator()

getFocusAccelerator sample code for javax.swing.text.JTextComponent.getFocusAccelerator() definition code for javax.swing.text.JTextComponent.getFocusAccelerator()

public char getFocusAccelerator()
Returns the key accelerator that will cause the receiving text component to get the focus. Return '\0' if no focus accelerator has been set.

Returns:
the key

read sample code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object) definition code for javax.swing.text.JTextComponent.read(java.io.Reader, java.lang.Object)

public void read(Reader sample code for java.io.Reader definition code for java.io.Reader  in,
                 Object sample code for java.lang.Object definition code for java.lang.Object  desc)
          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Initializes from a stream. This creates a model of the type appropriate for the component and initializes the model from the stream. By default this will load the model as plain text. Previous contents of the model are discarded.

Parameters:
in - the stream to read from
desc - an object describing the stream; this might be a string, a File, a URL, etc. Some kinds of documents (such as html for example) might be able to make use of this information; if non-null, it is added as a property of the document
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - as thrown by the stream being used to initialize
See Also:
EditorKit.createDefaultDocument() sample code for javax.swing.text.EditorKit.createDefaultDocument() definition code for javax.swing.text.EditorKit.createDefaultDocument() , setDocument(javax.swing.text.Document) sample code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) definition code for javax.swing.text.JTextComponent.setDocument(javax.swing.text.Document) , PlainDocument sample code for javax.swing.text.PlainDocument definition code for javax.swing.text.PlainDocument

write sample code for javax.swing.text.JTextComponent.write(java.io.Writer) definition code for javax.swing.text.JTextComponent.write(java.io.Writer)

public void write(Writer sample code for java.io.Writer definition code for java.io.Writer  out)
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Stores the contents of the model into the given stream. By default this will store the model as plain text.

Parameters:
out - the output stream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - on any I/O error

removeNotify sample code for javax.swing.text.JTextComponent.removeNotify() definition code for javax.swing.text.JTextComponent.removeNotify()

public void removeNotify()
Description copied from class: JComponent sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify()
Notifies this component that it no longer has a parent component. When this method is invoked, any KeyboardActions set up in the the chain of parent components are removed.

Overrides:
removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)

setCaretPosition sample code for javax.swing.text.JTextComponent.setCaretPosition(int) definition code for javax.swing.text.JTextComponent.setCaretPosition(int)

public void setCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent. Note that the caret tracks change, so this may move if the underlying text of the component is changed. If the document is null, does nothing. The position must be between 0 and the length of the component's text or else an exception is thrown.

Parameters:
position - the position
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the value supplied for position is less than zero or greater than the component's text length

getCaretPosition sample code for javax.swing.text.JTextComponent.getCaretPosition() definition code for javax.swing.text.JTextComponent.getCaretPosition()

public int getCaretPosition()
Returns the position of the text insertion caret for the text component.

Returns:
the position of the text insertion caret for the text component >= 0

setText sample code for javax.swing.text.JTextComponent.setText(java.lang.String) definition code for javax.swing.text.JTextComponent.setText(java.lang.String)

public void setText(String sample code for java.lang.String definition code for java.lang.String  t)
Sets the text of this TextComponent to the specified text. If the text is null or empty, has the effect of simply deleting the old text. When text has been inserted, the resulting caret location is determined by the implementation of the caret class.

This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information. Note that text is not a bound property, so no PropertyChangeEvent is fired when it changes. To listen for changes to the text, use DocumentListener.

Parameters:
t - the new text to be set
See Also:
getText(int, int) sample code for javax.swing.text.JTextComponent.getText(int, int) definition code for javax.swing.text.JTextComponent.getText(int, int) , DefaultCaret sample code for javax.swing.text.DefaultCaret definition code for javax.swing.text.DefaultCaret

getText sample code for javax.swing.text.JTextComponent.getText() definition code for javax.swing.text.JTextComponent.getText()

public String sample code for java.lang.String definition code for java.lang.String  getText()
Returns the text contained in this TextComponent. If the underlying document is null, will give a NullPointerException. Note that text is not a bound property, so no PropertyChangeEvent is fired when it changes. To listen for changes to the text, use DocumentListener.

Returns:
the text
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if the document is null
See Also:
setText(java.lang.String) sample code for javax.swing.text.JTextComponent.setText(java.lang.String) definition code for javax.swing.text.JTextComponent.setText(java.lang.String)

getSelectedText sample code for javax.swing.text.JTextComponent.getSelectedText() definition code for javax.swing.text.JTextComponent.getSelectedText()

public String sample code for java.lang.String definition code for java.lang.String  getSelectedText()
Returns the selected text contained in this TextComponent. If the selection is null or the document empty, returns null.

Returns:
the text
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the selection doesn't have a valid mapping into the document for some reason
See Also:
setText(java.lang.String) sample code for javax.swing.text.JTextComponent.setText(java.lang.String) definition code for javax.swing.text.JTextComponent.setText(java.lang.String)

isEditable sample code for javax.swing.text.JTextComponent.isEditable() definition code for javax.swing.text.JTextComponent.isEditable()

public boolean isEditable()
Returns the boolean indicating whether this TextComponent is editable or not.

Returns:
the boolean value
See Also:
setEditable(boolean) sample code for javax.swing.text.JTextComponent.setEditable(boolean) definition code for javax.swing.text.JTextComponent.setEditable(boolean)

setEditable sample code for javax.swing.text.JTextComponent.setEditable(boolean) definition code for javax.swing.text.JTextComponent.setEditable(boolean)

public void setEditable(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be editable. A PropertyChange event ("editable") is fired when the state is changed.

Parameters:
b - the boolean to be set
See Also:
isEditable() sample code for javax.swing.text.JTextComponent.isEditable() definition code for javax.swing.text.JTextComponent.isEditable()

getSelectionStart sample code for javax.swing.text.JTextComponent.getSelectionStart() definition code for javax.swing.text.JTextComponent.getSelectionStart()

public int getSelectionStart()
Returns the selected text's start position. Return 0 for an empty document, or the value of dot if no selection.

Returns:
the start position >= 0

setSelectionStart sample code for javax.swing.text.JTextComponent.setSelectionStart(int) definition code for javax.swing.text.JTextComponent.setSelectionStart(int)

public void setSelectionStart(int selectionStart)
Sets the selection start to the specified position. The new starting point is constrained to be before or at the current selection end.

This is available for backward compatibility to code that called this method on java.awt.TextComponent. This is implemented to forward to the Caret implementation which is where the actual selection is maintained.

Parameters:
selectionStart - the start position of the text >= 0

getSelectionEnd sample code for javax.swing.text.JTextComponent.getSelectionEnd() definition code for javax.swing.text.JTextComponent.getSelectionEnd()

public int getSelectionEnd()
Returns the selected text's end position. Return 0 if the document is empty, or the value of dot if there is no selection.

Returns:
the end position >= 0

setSelectionEnd sample code for javax.swing.text.JTextComponent.setSelectionEnd(int) definition code for javax.swing.text.JTextComponent.setSelectionEnd(int)

public void setSelectionEnd(int selectionEnd)
Sets the selection end to the specified position. The new end point is constrained to be at or after the current selection start.

This is available for backward compatibility to code that called this method on java.awt.TextComponent. This is implemented to forward to the Caret implementation which is where the actual selection is maintained.

Parameters:
selectionEnd - the end position of the text >= 0

select sample code for javax.swing.text.JTextComponent.select(int, int) definition code for javax.swing.text.JTextComponent.select(int, int)

public void select(int selectionStart,
                   int selectionEnd)
Selects the text between the specified start and end positions.

This method sets the start and end positions of the selected text, enforcing the restriction that the start position must be greater than or equal to zero. The end position must be greater than or equal to the start position, and less than 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. Specifically, if the start position or end position is greater than the length of the text, it is reset to equal the text length. If the start position is less than zero, it is reset to zero, and if the end position is less than the start position, it is reset to the start position.

This call is provided for backward compatibility. It is routed to a call to setCaretPosition followed by a call to moveCaretPosition. The preferred way to manage selection is by calling those methods directly.

Parameters:
selectionStart - the start position of the text
selectionEnd - the end position of the text
See Also:
setCaretPosition(int) sample code for javax.swing.text.JTextComponent.setCaretPosition(int) definition code for javax.swing.text.JTextComponent.setCaretPosition(int) , moveCaretPosition(int) sample code for javax.swing.text.JTextComponent.moveCaretPosition(int) definition code for javax.swing.text.JTextComponent.moveCaretPosition(int)

selectAll sample code for javax.swing.text.JTextComponent.selectAll() definition code for javax.swing.text.JTextComponent.selectAll()

public void selectAll()
Selects all the text in the TextComponent. Does nothing on a null or empty document.


getToolTipText sample code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent)

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Returns the string to be used as the tooltip for event. This will return one of:
  1. If setToolTipText has been invoked with a non-null value, it will be returned, otherwise
  2. The value from invoking getToolTipText on the UI will be returned.
By default JTextComponent does not register itself with the ToolTipManager. This means that tooltips will NOT be shown from the TextUI unless registerComponent has been invoked on the ToolTipManager.

Overrides:
getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Parameters:
event - the event in question
Returns:
the string to be used as the tooltip for event
See Also:
JComponent.setToolTipText(java.lang.String) sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) sample code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) , ToolTipManager.registerComponent(javax.swing.JComponent) sample code for javax.swing.ToolTipManager.registerComponent(javax.swing.JComponent) definition code for javax.swing.ToolTipManager.registerComponent(javax.swing.JComponent)

getPreferredScrollableViewportSize sample code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize() definition code for javax.swing.text.JTextComponent.getPreferredScrollableViewportSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for a view component. This is implemented to do the default behavior of returning the preferred size of the component.

Specified by:
getPreferredScrollableViewportSize sample code for javax.swing.Scrollable.getPreferredScrollableViewportSize() definition code for javax.swing.Scrollable.getPreferredScrollableViewportSize() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
the preferredSize of a JViewport whose view is this Scrollable
See Also:
JComponent.getPreferredSize() sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize()

getScrollableUnitIncrement sample code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

public int getScrollableUnitIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                      int orientation,
                                      int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. Ideally, components should handle a partially exposed row or column by returning the distance required to completely expose the item.

The default implementation of this is to simply return 10% of the visible area. Subclasses are likely to be able to provide a much more reasonable value.

Specified by:
getScrollableUnitIncrement sample code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "unit" increment for scrolling in the specified direction
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - for an invalid orientation
See Also:
JScrollBar.setUnitIncrement(int) sample code for javax.swing.JScrollBar.setUnitIncrement(int) definition code for javax.swing.JScrollBar.setUnitIncrement(int)

getScrollableBlockIncrement sample code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.text.JTextComponent.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

public int getScrollableBlockIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                       int orientation,
                                       int direction)
Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation.

The default implementation of this is to simply return the visible area. Subclasses will likely be able to provide a much more reasonable value.

Specified by:
getScrollableBlockIncrement sample code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "block" increment for scrolling in the specified direction
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - for an invalid orientation
See Also:
JScrollBar.setBlockIncrement(int) sample code for javax.swing.JScrollBar.setBlockIncrement(int) definition code for javax.swing.JScrollBar.setBlockIncrement(int)

getScrollableTracksViewportWidth sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportWidth()

public boolean getScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport. For example a normal text view that supported line wrapping would return true here, since it would be undesirable for wrapped lines to disappear beyond the right edge of the viewport. Note that returning true for a Scrollable whose ancestor is a JScrollPane effectively disables horizontal scrolling.

Scrolling containers, like JViewport, will use this method each time they are validated.

Specified by:
getScrollableTracksViewportWidth sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
true if a viewport should force the Scrollables width to match its own

getScrollableTracksViewportHeight sample code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight() definition code for javax.swing.text.JTextComponent.getScrollableTracksViewportHeight()

public boolean getScrollableTracksViewportHeight()
Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport. For example a columnar text view that flowed text in left to right columns could effectively disable vertical scrolling by returning true here.

Scrolling containers, like JViewport, will use this method each time they are validated.

Specified by:
getScrollableTracksViewportHeight sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
true if a viewport should force the Scrollables height to match its own

getAccessibleContext sample code for javax.swing.text.JTextComponent.getAccessibleContext() definition code for javax.swing.text.JTextComponent.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this JTextComponent. For text components, the AccessibleContext takes the form of an AccessibleJTextComponent. A new AccessibleJTextComponent instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
an AccessibleJTextComponent that serves as the AccessibleContext of this JTextComponent

paramString sample code for javax.swing.text.JTextComponent.paramString() definition code for javax.swing.text.JTextComponent.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this JTextComponent. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overriding paramString to provide information about the specific new aspects of the JFC components.

Overrides:
paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
a string representation of this JTextComponent

processInputMethodEvent sample code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for javax.swing.text.JTextComponent.processInputMethodEvent(java.awt.event.InputMethodEvent)

protected void processInputMethodEvent(InputMethodEvent sample code for java.awt.event.InputMethodEvent definition code for java.awt.event.InputMethodEvent  e)
Description copied from class: Component sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent)
Processes input method events occurring on this component by dispatching them to any registered InputMethodListener objects.

This method is not called unless input method events are enabled for this component. Input method events are enabled when one of the following occurs:

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Overrides:
processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
e - the input method event
See Also:
InputMethodEvent sample code for java.awt.event.InputMethodEvent definition code for java.awt.event.InputMethodEvent , InputMethodListener sample code for java.awt.event.InputMethodListener definition code for java.awt.event.InputMethodListener , Component.addInputMethodListener(java.awt.event.InputMethodListener) sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , Component.enableEvents(long) sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long)

getInputMethodRequests sample code for javax.swing.text.JTextComponent.getInputMethodRequests() definition code for javax.swing.text.JTextComponent.getInputMethodRequests()

public InputMethodRequests sample code for java.awt.im.InputMethodRequests definition code for java.awt.im.InputMethodRequests  getInputMethodRequests()
Description copied from class: Component sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests()
Gets the input method request handler which supports requests from input methods for this component. A component that supports on-the-spot text input must override this method to return an InputMethodRequests instance. At the same time, it also has to handle input method events.

Overrides:
getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the input method request handler for this component, null by default
See Also:
Component.addInputMethodListener(java.awt.event.InputMethodListener) sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener)

addInputMethodListener sample code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener) definition code for javax.swing.text.JTextComponent.addInputMethodListener(java.awt.event.InputMethodListener)

public void addInputMethodListener(InputMethodListener sample code for java.awt.event.InputMethodListener definition code for java.awt.event.InputMethodListener  l)
Description copied from class: Component sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener)
Adds the specified input method listener to receive input method events from this component. A component will only receive input method events from input methods if it also overrides getInputMethodRequests to return an InputMethodRequests instance. If listener l is null, no exception is thrown and no action is performed.

Overrides:
addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
l - the input method listener
See Also:
InputMethodEvent sample code for java.awt.event.InputMethodEvent definition code for java.awt.event.InputMethodEvent , InputMethodListener sample code for java.awt.event.InputMethodListener definition code for java.awt.event.InputMethodListener , Component.removeInputMethodListener(java.awt.event.InputMethodListener) sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , Component.getInputMethodListeners() sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , Component.getInputMethodRequests() sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests()