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

JFormattedTextField with url format shows / in front of the url

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 18
    • 17, 18
    • client-libs
    • b12
    • 17
    • x86_64
    • generic

      I have a frame with different type of JFormattedTextField. All the JFormattedTextField are set to Right to Left orientation & do see the JFormattedTextField and its content are set correctly expect URL format.
      The url is very simple http://www.oracle.com/ . The character / is seen before the the url in case of Right to left.

      Attached two test cases
      1) Testcase JFormattedTextFieldRTLTest.java shows different JFormattedTextField with Right to left orientation
      2) Testcase JFormattedTextFieldWithURLFormatBug.java shows only JFormattedTextField one with Left to right and another with right to left which is a simplified version of the first case.

      Step to reproduce
      1) Run both the test cases and observe that Right to left orientation url formatted JFormattedTextField value where character / is seen before http. If you see the same then the bug is reproduced.

      This is introduced in JDK 17 b12 onwards. This works fine in older JDK tested from JDK 8 onwards till JDK 17 b11.
      Reproduced on Ubuntu and Mac 10.15.7 macOS Catalina.

        1. JFormattedTextFieldRTLTest.java
          4 kB
          Lawrence Andrews
        2. JFormattedTextFieldWithURLFormatBug.java
          1 kB
          Lawrence Andrews
        3. Screen Shot 2021-09-08 at 12.54.07 PM.png
          23 kB
          Lawrence Andrews
        4. Screen Shot 2021-09-08 at 12.55.04 PM.png
          23 kB
          Lawrence Andrews
        5. Screen Shot 2021-09-08 at 2.34.49 PM.png
          392 kB
          Lawrence Andrews
        6. Screen Shot 2021-09-08 at 2.37.28 PM.png
          380 kB
          Lawrence Andrews

            psadhukhan Prasanta Sadhukhan
            landrews Lawrence Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: