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

MaskFormatter API documentation refers to getDisplayValue

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ndcosta Nelson Dcosta
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: