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: Building MRJAdapter on Leopard



Jean-Christophe Helary wrote:

Let me put the question the other way...

Is there a method to have a "normal" application menu (with Quit not
in the original menu but in the application menu, and a About item in
the same menu) without using MRJAdapter ?


Apple puts the "Quit", "Preferences" and "About" items in the application menu. They are there in a Mac Java app regardless of what other software you use. Keeping the items out of other menus (e.g. Quit/Exit in the File menu) is up to your code. By default Apple hooks up "Quit" to System.exit. Apple provides APIs to hook listeners to these menu items. See the Apple extensions JavaDoc:

http://developer.apple.com/documentation/Java/Reference/1.5.0/ appledoc/api/index.html

Implementing this in a manner that works on all platforms, regardless of the existence of the Apple extensions in the classpath is not rocket science, but does require some attention to detail and an understanding of how class loading works (and thus how it fails when the extensions are not present). MRJAdapter encapsulates those details. Apple also provides sample code on using the extensions, which can provide some insight into these details, if not a fully abstracted solution:

http://developer.apple.com/samplecode/OSXAdapter/index.html
_______________________________________________
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.