Example usage for Java javax.swing JFormattedTextField fields, constructors, methods, implement or subclass
The text is from its open source code.
int | COMMIT Constant identifying that when focus is lost, commitEdit should be invoked. |
int | COMMIT_OR_REVERT Constant identifying that when focus is lost, commitEdit should be invoked. |
int | PERSIST Constant identifying that when focus is lost, the edited value should be left. |
JFormattedTextField(Object value) Creates a JFormattedTextField with the specified value. | |
JFormattedTextField(java.text.Format format) Creates a JFormattedTextField . | |
JFormattedTextField(AbstractFormatter formatter) Creates a JFormattedTextField with the specified AbstractFormatter . | |
JFormattedTextField(AbstractFormatterFactory factory) Creates a JFormattedTextField with the specified AbstractFormatterFactory . | |
JFormattedTextField(AbstractFormatterFactory factory, Object currentValue) Creates a JFormattedTextField with the specified AbstractFormatterFactory and initial value. | |
JFormattedTextField() Creates a JFormattedTextField with no AbstractFormatterFactory . |
void | addActionListener(ActionListener l) Adds the specified action listener to receive action events from this textfield. |
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 | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | commitEdit() Forces the current value to be taken from the AbstractFormatter and set as the current value. |
int | getCaretPosition() Returns the position of the text insertion caret for the text component. |
Document | getDocument() Fetches the model associated with the editor. |
AbstractFormatter | getFormatter() Returns the AbstractFormatter that is used to format and parse the current value. |
AbstractFormatterFactory | getFormatterFactory() Returns the current AbstractFormatterFactory . |
String | getName() Gets the name of the component. |
String | getText() Returns the text contained in this TextComponent . |
Object | getValue() Returns the last valid value. |
boolean | isEditValid() Returns true if the current value being edited is valid. |
void | selectAll() Selects all the text in the TextComponent . |
void | setActionCommand(String command) Sets the command string used for action events. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setCaretPosition(int position) Sets the position of the text insertion caret for the TextComponent . |
void | setColumns(int columns) Sets the number of columns in this TextField , and then invalidate the layout. |
void | setEditable(boolean b) Sets the specified boolean to indicate whether or not this TextComponent should be editable. |
void | setFocusLostBehavior(int behavior) Sets the behavior when focus is lost. |
void | setFont(Font f) Sets the current font. |
void | setForeground(Color fg) Sets the foreground color of this component. |
void | setFormatterFactory(AbstractFormatterFactory tf) Sets the AbstractFormatterFactory . |
void | setHorizontalAlignment(int alignment) Sets the horizontal alignment of the text. |
void | setInputVerifier(InputVerifier inputVerifier) Sets the input verifier for this component. |
void | setMargin(Insets m) Sets margin space between the text component's border and its text. |
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 | setValue(Object value) Sets the value that will be formatted by an AbstractFormatter obtained from the current AbstractFormatterFactory . |