Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6462028

MaskFormatter API documentation refers to getDisplayValue

XMLWordPrintable

    • b03
    • x86
    • windows_xp

      A DESCRIPTION OF THE PROBLEM :
      In Javadoc for class is this example:

      MaskFormatter formatter = new MaskFormatter("###-####");
      formatter.setPlaceholderCharacter('_');
      formatter.getDisplayValue(tf, "123");

      But MaskFormatter doesn't have getDisplayValue().
      I check it also in Java 5, here is this bug too.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      corect example
      ACTUAL -
      When initially formatting a value if the length of the string is less than the length of the mask, two things can happen. Either the placeholder string will be used, or the placeholder character will be used. Precedence is given to the placeholder string. For example:

         MaskFormatter formatter = new MaskFormatter("###-####");
         formatter.setPlaceholderCharacter('_');
         formatter.getDisplayValue(tf, "123");

      URL OF FAULTY DOCUMENTATION :
      http://download.java.net/jdk6/docs/api/javax/swing/text/MaskFormatter.html

            tr Tejesh R
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: