United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6584657 GTK Look and Feel: Bugs in menu item layout
JDK-6584657 : GTK Look and Feel: Bugs in menu item layout

Details
Type:
Bug
Submit Date:
2007-07-24
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10,7
Fixed Versions:

Related Reports
Backport:
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
There is a fix for 6458123 CR: Bugs in menu item layout. It fixes menu item bugs for several L&Fs, but doesn't for GTK L&F. This CR is targeted to solve menu item problems under GTK L&F.

There are the following problems in GTK L&F (a test case and screen shots are in the attachment):
1. Menu item width is too small when a top-level item has an icon. (bug_1.png)
2. Horizontal text position and vertical text position are not processed correctly. (bug_2.png)
3. Horizontal alignment and vertical alignment are not processed correctly. (bug_3.png)

Testing strategy:
1. Run the GTKMenuItems.main()
2. Select the GTK L&F with a radio button
3. Try to open each drop-down menu to see the problems
Copied from the description of a duplicate CR 6687241:

Platform: Solaris 11, Redhat Linux 5
locale: Arabic and Hebrew
build: 6u10 b21.

This problem exists since 1.4.2_17.

To reproduce the bug:
Choose Solaris or Redhat Linux platform.
1. Install jdk6u10 b21
2. Install test tools GS-Tonga_12.zip
3.Set test environment
4. run runnit.sh script: sh runnit.sh -keywords:"ar&&manual"
5. Follow to JMenuItemTest.  Change LAF to GTK+ from LookAndFeel menu.  Click "TestMenu".  Then focus mouse to "Radio Button Menu Item"  of right-to-left menuitem.
6.  Note  "Alt-1" , the word has been truncated.

Or compiled and run the application separately:  i18n_mustang_ws\i18n\src\GS-Manual\ComponentOrientationTest\JMenuItemTest.java
I have compiled and archived it as JMenuItemTest.jar in attachment.  Execute "$JAVA_HOME/bin/java -jar JMenuItemTest.jar"  to reproduce the bug:
1. Execute "$JAVA_HOME/bin/java -jar JMenuItemTest.jar"
2. Change LAF to GTK+ from LookAndFeel menu.  Click "TestMenu".  Then focus mouse to "Radio Button Menu Item"  of right-to-left menuitem.
3.  Note  "Alt-1" , the word has been truncated.

src.zip file is source code of JMenuItemTest.jar in attachemt.
*** (#1 of 2): 2008-04-11 10:57:56 MSD ###@###.###

I can reproduce this in any locale. So, it's not specific to Arabic/Hebrew. But it looks like related to rendering or layout related to right-to-left component-orientation and/or gtk, shown by the following part of the code:

  menu.add(menuItem);
        menuItem = new JRadioButtonMenuItem("Radio Button Menu Item");
        menuItem.setComponentOrientation(o);
        menuItem.setSelected(true);
        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1,
                                                       ActionEvent.ALT_MASK));
Also, the RadioButton looks like a checkbox in this test case in all 3 look and feels.
*** (#2 of 2): 2008-04-11 20:45:21 MSD ###@###.###

                                    

Comments
EVALUATION

The problems can be fixed exactly as in the fix for 6458123 because SynthMenuItemUI is almost the same as BasicMenuItemUI.
                                     
2007-07-24
SUGGESTED FIX

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



Hardware and Software, Engineered to Work Together