JDK-6192422 : Accessibility bug: setJMenuBar does not place the menubar into component hierarchy
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 1.4.2_10
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2004-11-08
  • Updated: 2011-03-25
  • Resolved: 2005-04-13
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.
Other JDK 6
5.0u4Fixed 6 b32Fixed
Description
This problem surfaced with the upcoming JDS release which mandates that all applications must be accessible. The only supported Java application is the Java Media Player. It uses setJMenuBar to add the menubar to the main window's JFrame. 

There is a workaround, however, it requires that all Java Application using setJMenuBar must be re-written to be fully accessible.

The problem occurs on JDS, Build 21, Linux (x86). Accessibility was tested through the Gnome Onscreen Keyboard application (GOK).

Most likely, all other target platforms are impacted as well.

###@###.### 2004-11-08 22:58:24 GMT

Comments
EVALUATION No, Swing doesn't add the menu to the content pane or the frame directly. It adds it to the JLayeredPane. This is part of the component hierarchy. This is not a bug in Swing and I'd like to close it as not a bug. But perhaps there's something more that the accessibility tools need to do. I'm not sure so I'll assign to them to check. ###@###.### 2004-11-09 21:24:10 GMT This bug needs more investigation. ###@###.### 2004-12-02 00:52:49 GMT
09-11-2004

WORK AROUND The workaround is to use: getContentPane().add(menuBar, BorderLayout.NORTH); instead of: setJMenuBar(menuBar); ###@###.### 2004-11-08 22:58:24 GMT
08-11-2004