javax.swing
Class JTextField

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 sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent 
                  extended by javax.swing.JTextField
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 , SwingConstants sample code for javax.swing.SwingConstants definition code for javax.swing.SwingConstants
Direct Known Subclasses:
DefaultTreeCellEditor.DefaultTextField sample code for javax.swing.tree.DefaultTreeCellEditor.DefaultTextField definition code for javax.swing.tree.DefaultTreeCellEditor.DefaultTextField , JFormattedTextField sample code for javax.swing.JFormattedTextField definition code for javax.swing.JFormattedTextField , JPasswordField sample code for javax.swing.JPasswordField definition code for javax.swing.JPasswordField

public class JTextField
extends JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
implements SwingConstants sample code for javax.swing.SwingConstants definition code for javax.swing.SwingConstants

JTextField is a lightweight component that allows the editing of a single line of text. For information on and examples of using text fields, see How to Use Text Fields in The Java Tutorial.

JTextField is intended to be source-compatible with java.awt.TextField where it is reasonable to do so. This component has capabilities not found in the java.awt.TextField class. The superclass should be consulted for additional capabilities.

JTextField has a method to establish the string used as the command string for the action event that gets fired. The java.awt.TextField used the text of the field as the command string for the ActionEvent. JTextField will use the command string set with the setActionCommand method if not null, otherwise it will use the text of the field as a compatibility with java.awt.TextField.

The method setEchoChar and getEchoChar are not provided directly to avoid a new implementation of a pluggable look-and-feel inadvertently exposing password characters. To provide password-like services a separate class JPasswordField extends JTextField to provide this service with an independently pluggable look-and-feel.

The java.awt.TextField could be monitored for changes by adding a TextListener for TextEvent's. In the JTextComponent based components, changes are broadcasted from the model via a DocumentEvent to DocumentListeners. The DocumentEvent gives the location of the change and the kind of change if desired. The code fragment might look something like:


     DocumentListener myListener = ??;
     JTextField myArea = ??;
     myArea.getDocument().addDocumentListener(myListener);
 

The horizontal alignment of JTextField can be set to be left justified, leading justified, centered, right justified or trailing justified. Right/trailing justification is useful if the required size of the field text is smaller than the size allocated to it. This is determined by the setHorizontalAlignment and getHorizontalAlignment methods. The default is to be leading justified.

How the text field consumes VK_ENTER events depends on whether the text field has any action listeners. If so, then VK_ENTER results in the listeners getting an ActionEvent, and the VK_ENTER event is consumed. This is compatible with how AWT text fields handle VK_ENTER events. If the text field has no action listeners, then as of v 1.3 the VK_ENTER event is not consumed. Instead, the bindings of ancestor components are processed, which enables the default button feature of JFC/Swing to work.

Customized fields can easily be created by extending the model and changing the default model provided. For example, the following piece of code will create a field that holds only upper case characters. It will work even if text is pasted into from the clipboard or it is altered via programmatic changes.



 public class UpperCaseField extends JTextField {
 
     public UpperCaseField(int cols) {
         super(cols);
     }
 
     protected Document createDefaultModel() {
         return new UpperCaseDocument();
     }
 
     static class UpperCaseDocument extends PlainDocument {
 
         public void insertString(int offs, String str, AttributeSet a) 
             throws BadLocationException {
 
             if (str == null) {
                 return;
             }
             char[] upper = str.toCharArray();
             for (int i = 0; i < upper.length; i++) {
                 upper[i] = Character.toUpperCase(upper[i]);
             }
             super.insertString(offs, new String(upper), a);
         }
     }
 }

 

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:
setActionCommand(java.lang.String) sample code for javax.swing.JTextField.setActionCommand(java.lang.String) definition code for javax.swing.JTextField.setActionCommand(java.lang.String) , JPasswordField sample code for javax.swing.JPasswordField definition code for javax.swing.JPasswordField , addActionListener(java.awt.event.ActionListener) sample code for javax.swing.JTextField.addActionListener(java.awt.event.ActionListener) definition code for javax.swing.JTextField.addActionListener(java.awt.event.ActionListener) , Serialized Form

Nested Class Summary
protected  class JTextField.AccessibleJTextField sample code for javax.swing.JTextField.AccessibleJTextField definition code for javax.swing.JTextField.AccessibleJTextField
          This class implements accessibility support for the JTextField class.
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent sample code for javax.swing.text.JTextComponent.AccessibleJTextComponent definition code for javax.swing.text.JTextComponent.AccessibleJTextComponent , JTextComponent.KeyBinding sample code for javax.swing.text.JTextComponent.KeyBinding definition code for javax.swing.text.JTextComponent.KeyBinding
 
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 notifyAction sample code for javax.swing.JTextField.notifyAction definition code for javax.swing.JTextField.notifyAction
          Name of the action to send notification that the contents of the field have been accepted.
 
Fields inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
DEFAULT_KEYMAP sample code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP definition code for javax.swing.text.JTextComponent.DEFAULT_KEYMAP , FOCUS_ACCELERATOR_KEY sample code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY definition code for javax.swing.text.JTextComponent.FOCUS_ACCELERATOR_KEY
 
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 javax.swing.SwingConstants sample code for javax.swing.SwingConstants definition code for javax.swing.SwingConstants
BOTTOM sample code for javax.swing.SwingConstants.BOTTOM definition code for javax.swing.SwingConstants.BOTTOM , CENTER sample code for javax.swing.SwingConstants.CENTER definition code for javax.swing.SwingConstants.CENTER , EAST sample code for javax.swing.SwingConstants.EAST definition code for javax.swing.SwingConstants.EAST , HORIZONTAL sample code for javax.swing.SwingConstants.HORIZONTAL definition code for javax.swing.SwingConstants.HORIZONTAL , LEADING sample code for javax.swing.SwingConstants.LEADING definition code for javax.swing.SwingConstants.LEADING , LEFT sample code for javax.swing.SwingConstants.LEFT definition code for javax.swing.SwingConstants.LEFT , NEXT sample code for javax.swing.SwingConstants.NEXT definition code for javax.swing.SwingConstants.NEXT , NORTH sample code for javax.swing.SwingConstants.NORTH definition code for javax.swing.SwingConstants.NORTH , NORTH_EAST sample code for javax.swing.SwingConstants.NORTH_EAST definition code for javax.swing.SwingConstants.NORTH_EAST , NORTH_WEST sample code for javax.swing.SwingConstants.NORTH_WEST definition code for javax.swing.SwingConstants.NORTH_WEST , PREVIOUS sample code for javax.swing.SwingConstants.PREVIOUS definition code for javax.swing.SwingConstants.PREVIOUS , RIGHT sample code for javax.swing.SwingConstants.RIGHT definition code for javax.swing.SwingConstants.RIGHT , SOUTH sample code for javax.swing.SwingConstants.SOUTH definition code for javax.swing.SwingConstants.SOUTH , SOUTH_EAST sample code for javax.swing.SwingConstants.SOUTH_EAST definition code for javax.swing.SwingConstants.SOUTH_EAST , SOUTH_WEST sample code for javax.swing.SwingConstants.SOUTH_WEST definition code for javax.swing.SwingConstants.SOUTH_WEST , TOP sample code for javax.swing.SwingConstants.TOP definition code for javax.swing.SwingConstants.TOP , TRAILING sample code for javax.swing.SwingConstants.TRAILING definition code for javax.swing.SwingConstants.TRAILING , VERTICAL sample code for javax.swing.SwingConstants.VERTICAL definition code for javax.swing.SwingConstants.VERTICAL , WEST sample code for javax.swing.SwingConstants.WEST definition code for javax.swing.SwingConstants.WEST
 
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
JTextField sample code for javax.swing.JTextField.JTextField() definition code for javax.swing.JTextField.JTextField() ()
          Constructs a new TextField.
JTextField sample code for javax.swing.JTextField.JTextField(javax.swing.text.Document, java.lang.String, int) definition code for javax.swing.JTextField.JTextField(javax.swing.text.Document, java.lang.String, int) (Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document  doc, String sample code for java.lang.String definition code for java.lang.String  text, int columns)
          Constructs a new JTextField that uses the given text storage model and the given number of columns.
JTextField sample code for javax.swing.JTextField.JTextField(int) definition code for javax.swing.JTextField.JTextField(int) (int columns)
          Constructs a new empty TextField with the specified number of columns.
JTextField sample code for javax.swing.JTextField.JTextField(java.lang.String) definition code for javax.swing.JTextField.JTextField(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  text)
          Constructs a new TextField initialized with the specified text.
JTextField sample code for javax.swing.JTextField.JTextField(java.lang.String, int) definition code for javax.swing.JTextField.JTextField(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  text, int columns)
          Constructs a new TextField initialized with the specified text and columns.
 
Method Summary
 void addActionListener sample code for javax.swing.JTextField.addActionListener(java.awt.event.ActionListener) definition code for javax.swing.JTextField.addActionListener(java.awt.event.ActionListener) (ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  l)
          Adds the specified action listener to receive action events from this textfield.
protected  void configurePropertiesFromAction sample code for javax.swing.JTextField.configurePropertiesFromAction(javax.swing.Action) definition code for javax.swing.JTextField.configurePropertiesFromAction(javax.swing.Action) (Action sample code for javax.swing.Action definition code for javax.swing.Action  a)
          Factory method which sets the ActionEvent source's properties according to values from the Action instance.
protected  PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener createActionPropertyChangeListener sample code for javax.swing.JTextField.createActionPropertyChangeListener(javax.swing.Action) definition code for javax.swing.JTextField.createActionPropertyChangeListener(javax.swing.Action) (Action sample code for javax.swing.Action definition code for javax.swing.Action  a)
          Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance.
protected  Document sample code for javax.swing.text.Document definition code for javax.swing.text.Document createDefaultModel sample code for javax.swing.JTextField.createDefaultModel() definition code for javax.swing.JTextField.createDefaultModel() ()
          Creates the default implementation of the model to be used at construction if one isn't explicitly given.
protected  void fireActionPerformed sample code for javax.swing.JTextField.fireActionPerformed() definition code for javax.swing.JTextField.fireActionPerformed() ()
          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.JTextField.getAccessibleContext() definition code for javax.swing.JTextField.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JTextField.
 Action sample code for javax.swing.Action definition code for javax.swing.Action getAction sample code for javax.swing.JTextField.getAction() definition code for javax.swing.JTextField.getAction() ()
          Returns the currently set Action for this ActionEvent source, or null if no Action is set.
 ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener [] getActionListeners sample code for javax.swing.JTextField.getActionListeners() definition code for javax.swing.JTextField.getActionListeners() ()
          Returns an array of all the ActionListeners added to this JTextField with addActionListener().
 Action sample code for javax.swing.Action definition code for javax.swing.Action [] getActions sample code for javax.swing.JTextField.getActions() definition code for javax.swing.JTextField.getActions() ()
          Fetches the command list for the editor.
 int getColumns sample code for javax.swing.JTextField.getColumns() definition code for javax.swing.JTextField.getColumns() ()
          Returns the number of columns in this TextField.
protected  int getColumnWidth sample code for javax.swing.JTextField.getColumnWidth() definition code for javax.swing.JTextField.getColumnWidth() ()
          Returns the column width.
 int getHorizontalAlignment sample code for javax.swing.JTextField.getHorizontalAlignment() definition code for javax.swing.JTextField.getHorizontalAlignment() ()
          Returns the horizontal alignment of the text.
 BoundedRangeModel sample code for javax.swing.BoundedRangeModel definition code for javax.swing.BoundedRangeModel getHorizontalVisibility sample code for javax.swing.JTextField.getHorizontalVisibility() definition code for javax.swing.JTextField.getHorizontalVisibility() ()
          Gets the visibility of the text field.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredSize sample code for javax.swing.JTextField.getPreferredSize() definition code for javax.swing.JTextField.getPreferredSize() ()
          Returns the preferred size Dimensions needed for this TextField.
 int getScrollOffset sample code for javax.swing.JTextField.getScrollOffset() definition code for javax.swing.JTextField.getScrollOffset() ()
          Gets the scroll offset, in pixels.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JTextField.getUIClassID() definition code for javax.swing.JTextField.getUIClassID() ()
          Gets the class ID for a UI.
 boolean isValidateRoot sample code for javax.swing.JTextField.isValidateRoot() definition code for javax.swing.JTextField.isValidateRoot() ()
          Calls to revalidate that come from within the textfield itself will be handled by validating the textfield, unless the textfield is contained within a JViewport, in which case this returns false.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JTextField.paramString() definition code for javax.swing.JTextField.paramString() ()
          Returns a string representation of this JTextField.
 void postActionEvent sample code for javax.swing.JTextField.postActionEvent() definition code for javax.swing.JTextField.postActionEvent() ()
          Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
 void removeActionListener sample code for javax.swing.JTextField.removeActionListener(java.awt.event.ActionListener) definition code for javax.swing.JTextField.removeActionListener(java.awt.event.ActionListener) (ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  l)
          Removes the specified action listener so that it no longer receives action events from this textfield.
 void scrollRectToVisible sample code for javax.swing.JTextField.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JTextField.scrollRectToVisible(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
          Scrolls the field left or right.
 void setAction sample code for javax.swing.JTextField.setAction(javax.swing.Action) definition code for javax.swing.JTextField.setAction(javax.swing.Action) (Action sample code for javax.swing.Action definition code for javax.swing.Action  a)
          Sets the Action for the ActionEvent source.
 void setActionCommand sample code for javax.swing.JTextField.setActionCommand(java.lang.String) definition code for javax.swing.JTextField.setActionCommand(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  command)
          Sets the command string used for action events.
 void setColumns sample code for javax.swing.JTextField.setColumns(int) definition code for javax.swing.JTextField.setColumns(int) (int columns)
          Sets the number of columns in this TextField, and then invalidate the layout.
 void setDocument sample code for javax.swing.JTextField.setDocument(javax.swing.text.Document) definition code for javax.swing.JTextField.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 setFont sample code for javax.swing.JTextField.setFont(java.awt.Font) definition code for javax.swing.JTextField.setFont(java.awt.Font) (Font sample code for java.awt.Font definition code for java.awt.Font  f)
          Sets the current font.
 void setHorizontalAlignment sample code for javax.swing.JTextField.setHorizontalAlignment(int) definition code for javax.swing.JTextField.setHorizontalAlignment(int) (int alignment)
          Sets the horizontal alignment of the text.
 void setScrollOffset sample code for javax.swing.JTextField.setScrollOffset(int) definition code for javax.swing.JTextField.setScrollOffset(int) (int scrollOffset)
          Sets the scroll offset, in pixels.
 
Methods inherited from class javax.swing.text.JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent
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) , 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) , 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) , copy sample code for javax.swing.text.JTextComponent.copy() definition code for javax.swing.text.JTextComponent.copy() , cut sample code for javax.swing.text.JTextComponent.cut() definition code for javax.swing.text.JTextComponent.cut() , 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) , getCaret sample code for javax.swing.text.JTextComponent.getCaret() definition code for javax.swing.text.JTextComponent.getCaret() , getCaretColor sample code for javax.swing.text.JTextComponent.getCaretColor() definition code for javax.swing.text.JTextComponent.getCaretColor() , getCaretListeners sample code for javax.swing.text.JTextComponent.getCaretListeners() definition code for javax.swing.text.JTextComponent.getCaretListeners() , getCaretPosition sample code for javax.swing.text.JTextComponent.getCaretPosition() definition code for javax.swing.text.JTextComponent.getCaretPosition() , getDisabledTextColor sample code for javax.swing.text.JTextComponent.getDisabledTextColor() definition code for javax.swing.text.JTextComponent.getDisabledTextColor() , getDocument sample code for javax.swing.text.JTextComponent.getDocument() definition code for javax.swing.text.JTextComponent.getDocument() , getDragEnabled sample code for javax.swing.text.JTextComponent.getDragEnabled() definition code for javax.swing.text.JTextComponent.getDragEnabled() , getFocusAccelerator sample code for javax.swing.text.JTextComponent.getFocusAccelerator() definition code for javax.swing.text.JTextComponent.getFocusAccelerator() , getHighlighter sample code for javax.swing.text.JTextComponent.getHighlighter() definition code for javax.swing.text.JTextComponent.getHighlighter() , getInputMethodRequests sample code for javax.swing.text.JTextComponent.getInputMethodRequests() definition code for javax.swing.text.JTextComponent.getInputMethodRequests() , getKeymap sample code for javax.swing.text.JTextComponent.getKeymap() definition code for javax.swing.text.JTextComponent.getKeymap() , getKeymap sample code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) definition code for javax.swing.text.JTextComponent.getKeymap(java.lang.String) , getMargin sample code for javax.swing.text.JTextComponent.getMargin() definition code for javax.swing.text.JTextComponent.getMargin() , getNavigatio