Example usage for Java javax.swing.text JTextComponent fields, constructors, methods, implement or subclass
The text is from its open source code.
String | DEFAULT_KEYMAP The default keymap that will be shared by all JTextComponent instances unless they have had a different keymap set. |
Component | add(Component comp) Appends the specified component to the end of this container. |
void | addCaretListener(CaretListener listener) Adds a caret listener for notification of any changes to the caret. |
void | addFocusListener(FocusListener l) Adds the specified focus listener to receive focus events from this component when this component gains input focus. |
void | addInputMethodListener(InputMethodListener l) |
void | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
Keymap | addKeymap(String nm, Keymap parent) Adds a new keymap into the keymap hierarchy. |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | copy() Transfers the currently selected range in the associated text model to the system clipboard, leaving the contents in the text model. |
void | cut() Transfers the currently selected range in the associated text model to the system clipboard, removing the contents from the model. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
ActionMap | getActionMap() Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding. |
Action[] | getActions() Fetches the command list for the editor. |
Color | getBackground() Gets the background color of this component. |
Caret | getCaret() Fetches the caret that allows text-oriented navigation over the view. |
Color | getCaretColor() Fetches the current color used to render the caret. |
int | getCaretPosition() Returns the position of the text insertion caret for the text component. |
Class> | getClass() Returns the runtime class of this Object . |
Object | getClientProperty(Object key) Returns the value of the property with the specified key. |
JPopupMenu | getComponentPopupMenu() Returns JPopupMenu that assigned for this component. |
Color | getDisabledTextColor() Fetches the current color used to render the disabled text. |
Document | getDocument() Fetches the model associated with the editor. |
Set | getFocusTraversalKeys(int id) Returns the Set of focus traversal keys for a given traversal operation for this Container. |
Font | getFont() Gets the font of this component. |
FontMetrics | getFontMetrics(Font font) Gets the FontMetrics for the specified Font . |
Color | getForeground() Gets the foreground color of this component. |
Highlighter | getHighlighter() Fetches the object responsible for making highlights. |
InputContext | getInputContext() Gets the input context used by this component for handling the communication with input methods when text is entered in this component. |
InputMap | getInputMap() Returns the InputMap that is used when the component has focus. |
InputMap | getInputMap(int condition) Returns the InputMap that is used during condition . |
Insets | getInsets() If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets . |
Keymap | getKeymap() Fetches the keymap currently active in this text component. |
Keymap | getKeymap(String nm) Fetches a named keymap previously added to the document. |
String | getName() Gets the name of the component. |
String | getSelectedText() Returns the selected text contained in this TextComponent . |
Color | getSelectedTextColor() Fetches the current color used to render the selected text. |
Color | getSelectionColor() Fetches the current color used to render the selection. |
int | getSelectionEnd() Returns the selected text's end position. |
int | getSelectionStart() Returns the selected text's start position. |
String | getText() Returns the text contained in this TextComponent . |
String | getText(int offs, int len) Fetches a portion of the text represented by the component. |
Toolkit | getToolkit() Gets the toolkit of this component. |
TextUI | getUI() Fetches the user-interface factory for this text-oriented editor. |
int | getWidth() Returns the current width of this component. |
boolean | isEditable() Returns the boolean indicating whether this TextComponent is editable or not. |
boolean | isEnabled() Determines whether this component is enabled. |
void | loadKeymap(Keymap map, KeyBinding[] bindings, Action[] actions) Loads a keymap with a bunch of bindings. |
Rectangle | modelToView(int pos) Converts the given location in the model to a place in the view coordinate system. |
void | moveCaretPosition(int pos) Moves the caret to a new position, leaving behind a mark defined by the last time setCaretPosition was called. |
void | paste() Transfers the contents of the system clipboard into the associated text model. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | read(Reader in, Object desc) Initializes from a stream. |
void | removeCaretListener(CaretListener listener) Removes a caret listener. |
void | replaceSelection(String content) Replaces the currently selected content with new content represented by the given string. |
void | requestFocus() Requests that this Component gets the input focus. |
boolean | requestFocusInWindow() Requests that this Component gets the input focus. |
void | select(int selectionStart, int selectionEnd) Selects the text between the specified start and end positions. |
void | selectAll() Selects all the text in the TextComponent . |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setCaretColor(Color c) Sets the current color used to render the caret. |
void | setCaretPosition(int position) Sets the position of the text insertion caret for the TextComponent . |
void | setComponentPopupMenu(JPopupMenu popup) Sets the JPopupMenu for this JComponent . |
void | setCursor(Cursor cursor) Sets the cursor image to the specified cursor. |
void | setDocument(Document doc) Associates the editor with a text document. |
void | setDragEnabled(boolean b) Turns on or off automatic drag handling. |
void | setEditable(boolean b) Sets the specified boolean to indicate whether or not this TextComponent should be editable. |
void | setEnabled(boolean enabled) Sets whether or not this component is enabled. |
void | setFocusable(boolean focusable) Sets the focusable state of this Component to the specified value. |
void | setFocusTraversalKeys(int id, Set extends AWTKeyStroke> keystrokes) Sets the focus traversal keys for a given traversal operation for this Component. |
void | setFont(Font font) Sets the font for this component. |
void | setForeground(Color fg) Sets the foreground color of this component. |
void | setSelectionColor(Color c) Sets the current color used to render the selection. |
void | setSelectionEnd(int selectionEnd) Sets the selection end to the specified position. |
void | setSelectionStart(int selectionStart) Sets the selection start to the specified position. |
void | setText(String t) Sets the text of this TextComponent to the specified text. |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | validate() Validates this container and all of its subcomponents. |
int | viewToModel(Point pt) Converts the given place in the view coordinate system to the nearest representative location in the model. |
void | write(Writer out) Stores the contents of the model into the given stream. |