JDK-6736649 : test/closed/javax/swing/JMenuItem/6458123/ManualBug6458123.java fails on Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-08-13
  • Updated: 2011-01-19
  • Resolved: 2008-10-15
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
6u23Fixed 7 b38Fixed
Related Reports
Relates :  
Description
test/closed/javax/swing/JMenuItem/6458123/ManualBug6458123.java fails on Linux

JDK: 7
OS: SuSe Linux v10.3
Window manager: Gnome
DesktopTheme: Synchronicity

Menu item "Radio Button, icon at the center and below text" in "Second RTL" menu under GTK L&F  has a visual defect. See the attached MenuItemBug.png file. Text and check icon don't have a gap. Text isn't aligned to the right with another menu items.

Comments
SUGGESTED FIX The approved webrev revision was copied to NFS: /net/sa.sfbay/export/home/swing/data/7/6736649.1 URL: http://sa.sfbay.sun.com/projects/swing_data/7/6736649.1
26-08-2008

EVALUATION The cause is in MenuItemLayoutHelper class. It uses SwingUtilities.layoutCompoundLabel() to determine label width and to lay out icon and text in the case of the complex layout. The method takes into account the text bearings for layout purposes, however it doesn't for text rectangle width calculation. In the case of the CENTER layout MenuItemLayoutHelper supposes label width is equal to the text rectangle width (without bearings). When it is time to lay out the label, text width turns out too small to do it. layoutCompoundLabel() trims the text, ends it with "..." and uses the trimmed text for layout. It causes the bug. A solution is simple. We should take into account the text bearings when we use layoutCompoundLabel() to determine the label width.
14-08-2008