Class GFormattedTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public class GFormattedTextField extends JFormattedTextField
GFormattedTextField provides an implementation of JFormattedTextField which facilitates entry validation with an indication of its current status.
When modified from its default value the field background will reflect its current status.
See Also:
  • Constructor Details

  • Method Details

    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Establish default value. Text field value should be set before invoking this method.
      Parameters:
      defaultValue - default value
    • getDefaultText

      public String getDefaultText()
      Returns the default text. This is useful to know what the original text is after the user has edited the text.
      Returns:
      the default text
    • disableFocusEventProcessing

      public void disableFocusEventProcessing()
    • getFocusLostBehavior

      public int getFocusLostBehavior()
      Overrides:
      getFocusLostBehavior in class JFormattedTextField
    • processFocusEvent

      protected void processFocusEvent(FocusEvent e)
      Overrides:
      processFocusEvent in class JFormattedTextField
    • getTextEntryStatus

      public GFormattedTextField.Status getTextEntryStatus()
    • addTextEntryStatusListener

      public void addTextEntryStatusListener(TextEntryStatusListener listener)
    • setText

      public void setText(String t)
      Overrides:
      setText in class JTextComponent
    • setIsError

      public void setIsError(boolean isError)
    • reset

      public void reset()
      Restores this field to its default text.
    • isChanged

      public boolean isChanged()
      Returns true if the contents of this field do not match the default.
      Returns:
      true if the contents of this field do not match the default.
    • isInvalid

      public boolean isInvalid()
      Returns true if the contents of this field are invalid, as determined by the InputValidator.
      Returns:
      true if the contents of this field are invalid, as determined by the InputValidator.
    • editingFinished

      public void editingFinished()