JDK-6465603 : GTKLAF: Menu item selection bar hieght is not consistant in the menu and popupmenu across the items.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2006-08-30
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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
6u1Fixed 7 b07Fixed
Related Reports
Relates :  
Description
Bug Info:
=========
The following variations I found in the JMenu & JPopupMenu while comparing with native menu and popupmenu.

1. The height of the menu highlighted bar is varying while navigate on different menu items in the menu by using java application but in native menu,the highlighted bar is consistent across all the menu items in the menu.

2.The highlighted bar touches the menu separator in java application but in native,the highlighted bar is not touches the separator and it shows some clear gap between the separator and highlighted bar.

I observed the same behavior on both popupmenu and menu.

JDK HOME:
=========
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b97)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b97, mixed mode)

Steps to Reproduce:
===================
Download the attached java code and execute.
For Menu:
---------
1. Click on Menu
2. Navigate either through mouse or keyboard arrows.

For PopupMenu:
-------------
1. Right click on frame and it shows the popupmenu.
2. Navigate either through mouse or keyboard arrows.

Expected Result:
================
1. The highlighted bar height should consistent across all the menu items.
2. The highlighted bar should not touches the separator.

Actual Result:
==============
1. The highlighted bar height is varying while navigate on menu items in the menu.
2. The highlighted bar touches the separator.

Please find the attached images.

In Native Application:
---------------------
If you compare the following two gif files which have captured at different menu item selection and you don't find any difference in the height of selection bar.
1. native_selectionbar_state1.gif
2. native_selectionbar_state2.gif

In Java Application:
--------------------
If you compare the following two gif file which have capture at different menu item selections and you find the clear difference in the height of the selection bar.
1.java_menu_selectionbar_state1.gif
2.java_menu_selectionbar_state2.gif
3.java_popup_selectionbar_state1.gif
4.java_popup_selectionbar_state2.gif

Comments
EVALUATION If we use separators inserted in Menu or Toolbar we have to return correct WidgetType for them. When we use JMenu.addSeparator or similar methods the correct WidgetType is returned accroding to the correct Region which is assigned to the correct uiClassID.
30-10-2006

EVALUATION If you want to have correct insets for separators in Menu you should use JMenu.addSeparator() or JPopupMenu.addSeparator() rather than JMenu.add(new JSeparator()).
24-10-2006

EVALUATION We should interpret Menu as a MenuItem in GTKStyle when we extract x/y thicknesses. We should also return CheckBoxMenuItem and RadioButtonMenuItem insets as insets for a menu item rather than for a button.
24-10-2006

EVALUATION There is a problem with different kind of insets.
04-09-2006