Java OS X Lion About the menu

I am trying to override the about menu in a Java application on OS X Lion or something from Leopard and above. How can I do it? The tutorials that I have read so far do not seem modern, some classes are no longer in the Java Mac SDK, and the events of others do not quit, alas.

Thanks in advance!

+4
source share
1 answer

You can find instructions at http://simplericity.com/2007/10/02/1191336060000.html if you use maven as the main Apple instructions at http://developer.apple.com/library/mac/documentation/Java /Reference/1.5.0/appledoc/api/index.html require reflection in order to reliably use Apple's JDK as well.

"This class allows your Java application to respond to Apple Apple Mac OS X events. To use this class:

  • Get an instance of the application.

  • Create an instance of one or more objects that implement the ApplicationListener interface. (The convenience class com.apple.eawt.ApplicationAdaptor is provided. Create an instance to handle the default events in the ApplicationListener interface).

  • Implement handlers for the relevant events.

  • Register the ApplicationAdaptor (s) with the Application object. "

Did you miss this part?


EDIT: This appears to have changed significantly in update 10.6 of Update 3 and 10.5 of 8 . Show normal java dialog inside handler in

Application a = Application.getApplication(); a.setAboutHandler(new AboutHandler() { public void handleAbout(AboutEvent arg0) { // here } }); 
+5
source

Source: https://habr.com/ru/post/1203524/


All Articles