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

Accelerator texts not aligned correctly in RTL menus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • client-libs

      FULL PRODUCT VERSION :
      Any version of Tiger and Mustang

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      The menu accelerators under RTL layout are not aligned correctly.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create an application with different menu items and set frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
      The accelerator texts are not aligned and many of them are cur by the window itself. See many screenshots of Metal, Windows and third-party LAFs that inherit them at http://weblogs.java.net/blog/kirillcool/archive/2006/02/aligning_menu_i_1.html

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Accelerator texts are aligned
      ACTUAL -
      Accelerator texts are partlt cut and not aligned

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      As described in https://looks.dev.java.net/issues/show_bug.cgi?id=111 the line

       accOffset = maxValue - acceleratorRect.width;

      (613 in Tiger) should be replaced by

       accOffset = menuItem.getComponentOrientation().isLeftToRight()
           ? maxValue - acceleratorRect.width
           : acceleratorRect.width - maxValue;

            mlapshin Mikhail Lapshin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: