JDK-6857360 : NimbusLAF: Menu indicator looks ugly with RTL orientation.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u23,7
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_10
  • CPU: generic,x86
  • Submitted: 2009-07-03
  • Updated: 2011-01-19
  • Resolved: 2009-08-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u23Fixed 7 b68Fixed OpenJDK6Fixed
Related Reports
Relates :  
Description
Bug Info
=========
I have lunched a application which contains a menu with sub childs.I have set the RTL orientation for menu,later I found that menu indicator is not rendering properly and look ugly.The problem with the JDK7 build and it works fine with 6u14 build.

Please find the attached image file for reference.

JDK Info
========
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b62)
Java HotSpot(TM) Client VM (build 16.0-b04, mixed mode)

Comments
EVALUATION Please use test\javax\swing\JMenuItem\6458123\ManualBug6458123.java to reproduce the problem, you should switch to Nimbus Laf and open the "First R2L" menu ManualBug6458123.png is attached to illustrate the *correct* visual appearance, please note that ManualBug6458123 uses random colors for menu icons they may be different from whay you see on the screenshot MenuIndicator.png shows the incorrect icons
10-11-2010

EVALUATION Two problems here: 1. sun.swing.MenuItemLayoutHelper.alignRect() adjusts x coordinate and width of a rectangle in case it is given more space than it needs. So it aligns the rectangle inside the allotted space, and restores its original width, but only if alignment != LEFT. In case of RTL menu, the arrow icon is aligned to the left, so the original width is not restored. The solution is to restore original width for all alignment types. 2. The arrow icon for an RTL menu points to the right, which is wrong. So i'm adding code to NimbusIcon that flips the icon for RTL menus.
16-07-2009