Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't see separators on Jmenu



Greg Guerin wrote:

David Leader wrote:

I've a number of apps I've written using AWT with menus with separators
that look fine on OSX.

So do I, but AWT Menubar and Menu are different classes than Swing JMenubar
and JMenu.


Also, the top-of-screen menubar is not the same as the in-window menubar.
I just tested the screen JMenubar and it worked: Mac OS 10.4.7 ppc or i386,
Java 1.4.2_09 or 1.5.0_06.


However, when I reconfigure the same app to use an in-window JMenubar,
separators appear only as gaps, not as lines, exactly as you've described.


The in-window JMenubar and JMenus are implemented using popup-menus (see
Sun's source), for which separators are known to not work on Mac OS X, not
even in 1.5.0_06.


The remedy is to use an AWT Menubar, or use a Swing JMenubar in
top-of-screen mode. The latter is controlled by setting
"apple.laf.useScreenMenuBar" property to true, or the older
"com.apple.macos.useScreenMenuBar". Both properties are honored in 1.4 or
1.5, and the resulting state is the OR of the two boolean values.

When using the screen menu bar on a Mac, the Swing menu bar and menus are not actually displayed -- Apple's runtime proxies all the Swing menu bar, menu and menu item instances with AWT instances that are displayed. So it looks like the issue with misrendered separators is the case for all Swing menus under OS X, it is just masked by the use of these AWT proxies when useScreenMenuBar is true.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.