Java javax.swing JFormattedTextField fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JFormattedTextField fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JFormattedTextField.

The text is from its open source code.

Subclass

javax.swing.JFormattedTextField has subclasses.
Click this link to see all its subclasses.

Field

intCOMMIT
Constant identifying that when focus is lost, commitEdit should be invoked.
intCOMMIT_OR_REVERT
Constant identifying that when focus is lost, commitEdit should be invoked.
intPERSIST
Constant identifying that when focus is lost, the edited value should be left.

Constructor

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.

Method

voidaddActionListener(ActionListener l)
Adds the specified action listener to receive action events from this textfield.
voidaddCaretListener(CaretListener listener)
Adds a caret listener for notification of any changes to the caret.
voidaddFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component when this component gains input focus.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidcommitEdit()
Forces the current value to be taken from the AbstractFormatter and set as the current value.
intgetCaretPosition()
Returns the position of the text insertion caret for the text component.
DocumentgetDocument()
Fetches the model associated with the editor.
AbstractFormattergetFormatter()
Returns the AbstractFormatter that is used to format and parse the current value.
AbstractFormatterFactorygetFormatterFactory()
Returns the current AbstractFormatterFactory.
StringgetName()
Gets the name of the component.
StringgetText()
Returns the text contained in this TextComponent.
ObjectgetValue()
Returns the last valid value.
booleanisEditValid()
Returns true if the current value being edited is valid.
voidselectAll()
Selects all the text in the TextComponent.
voidsetActionCommand(String command)
Sets the command string used for action events.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent.
voidsetColumns(int columns)
Sets the number of columns in this TextField, and then invalidate the layout.
voidsetEditable(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
voidsetFocusLostBehavior(int behavior)
Sets the behavior when focus is lost.
voidsetFont(Font f)
Sets the current font.
voidsetForeground(Color fg)
Sets the foreground color of this component.
voidsetFormatterFactory(AbstractFormatterFactory tf)
Sets the AbstractFormatterFactory.
voidsetHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text.
voidsetInputVerifier(InputVerifier inputVerifier)
Sets the input verifier for this component.
voidsetMargin(Insets m)
Sets margin space between the text component's border and its text.
voidsetText(String t)
Sets the text of this TextComponent to the specified text.
voidsetToolTipText(String text)
Registers the text to display in a tool tip.
voidsetValue(Object value)
Sets the value that will be formatted by an AbstractFormatter obtained from the current AbstractFormatterFactory.