Class JFormattedTextFieldHpr

    • Constructor Detail

      • JFormattedTextFieldHpr

        public JFormattedTextFieldHpr()
    • Method Detail

      • initInstance

        public void initInstance​(javax.swing.JComponent aComponent)
        Initializes the given instance (actually called the first time an owner is set).
        Overrides:
        initInstance in class JTextComponentHpr
      • getValue

        public java.lang.Object getValue​(javax.swing.JComponent aComponent)
        Returns a component's value.
        Overrides:
        getValue in class RJHelper
      • setValue

        public void setValue​(javax.swing.JComponent aComponent,
                             java.lang.Object aValue)
        Description copied from class: JTextComponentHpr
        Sets the given text component to the given value.
        Overrides:
        setValue in class JTextComponentHpr
      • getNumberValue

        public java.lang.Number getNumberValue​(javax.swing.JComponent aComponent)
        Returns the component's value as an Number. Used by all the get() methods
      • getIntValue

        public int getIntValue​(javax.swing.JComponent aComponent)
        Returns the component's value as an int. (if appropriate)
        Overrides:
        getIntValue in class JTextComponentHpr
      • getFloatValue

        public float getFloatValue​(javax.swing.JComponent aComponent)
        Returns the component's value as a float. (if appropriate)
        Overrides:
        getFloatValue in class JTextComponentHpr
      • focusLost

        public void focusLost​(javax.swing.JComponent aComponent,
                              java.awt.event.FocusEvent fe)
        Implemented to make sure formatter validates the data whenever the focus is lost (temporarily or permanently). Note that if the vale in the text field is invalid, focus will be allowed to changed, but the value in the text field will revert to what it was before the invalid edit. You would think the setFocusLostBehavior(COMMIT_OR_REVERT) would do this, but it doesn't. Plus it ignores temporary focus events.
        Overrides:
        focusLost in class RJHelper