/** * Installs the <code>DefaultFormatter</code> onto a particular <code>JFormattedTextField</code>. * This will invoke <code>valueToString</code> to convert the current value from the <code> * JFormattedTextField</code> to a String. This will then install the <code>Action</code>s from * <code>getActions</code>, the <code>DocumentFilter</code> returned from <code>getDocumentFilter * </code> and the <code>NavigationFilter</code> returned from <code>getNavigationFilter</code> * onto the <code>JFormattedTextField</code>. * * <p>Subclasses will typically only need to override this if they wish to install additional * listeners on the <code>JFormattedTextField</code>. * * <p>If there is a <code>ParseException</code> in converting the current value to a String, this * will set the text to an empty String, and mark the <code>JFormattedTextField</code> as being in * an invalid state. * * <p>While this is a public method, this is typically only useful for subclassers of <code> * JFormattedTextField</code>. <code>JFormattedTextField</code> will invoke this method at the * appropriate times when the value changes, or its internal state changes. * * @param ftf JFormattedTextField to format for, may be null indicating uninstall from current * JFormattedTextField. */ public void install(JFormattedTextField ftf) { super.install(ftf); updateMaskIfNecessary(); // invoked again as the mask should now be valid. positionCursorAtInitialLocation(); }