
416
|
Chapter 11, Native Integration and Packaging
#81 Make Mac Applications Behave Normally
HACK
AWT windows will always use the Mac menu bar.
One thing worth mentioning is that if your application uses different menus
in its various windows, this will still seem strange to Mac users, as the menu
bar will change based on which of your application’s windows has focus.
But to be truly Mac-like, you’d have to have the same menu bar all the time,
which on Windows/Linux might mean having completely inappropriate
menus in some windows. Then again, with good design—and probably
some
ResourceBundles—you should be able to provide an appropriate menu
bar experience to all your users.
Presenting an Appropriate Application Name
On Mac OS X, the first two items (reading left to right) on the menu bar are
the Apple menu, which controls the whole system (Software Update,
Restart, Log Out, etc.), and the Application menu. The Application menu is
meant to contain items relevant to the entire application: an about box, pref-
erences, the ability to hide itself or other applications, and Quit. But the
menu isn’t named Application; instead, it shows the current application’s
name. That’s great for something short and memorable like Mail or Firefox.
But for a Java application, it picks up the name of the application’s
main( )
class. And when you package your code (like you’re supposed to, with the
inverted Internet address ...