javamacosoverridingosx-lionabout-box

Java OS X Lion About Menu


I am trying to override the about menu in a Java Application on OS X Lion or anything from Leopard & above. How do I do that? The tutorials I have read so far do not seem up-to-date, some classes are no longer in the Java Mac SDK and others' events are not fired, alas.

Thanks in advance!


Solution

  • You might find the instructions on http://simplericity.com/2007/10/02/1191336060000.html interesting if you use maven as the underlying Apple instructions on http://developer.apple.com/library/mac/documentation/Java/Reference/1.5.0/appledoc/api/index.html require reflection to use reliably on non-Apple JDK's too.

    "This class permits your Java application to respond Mac OX X-specific Apple events. To use this class:

    Perhaps you missed this part?


    EDIT: It appears this was seriously changed in 10.6 update 3 and 10.5 update 8. Show a normal Java dialogue box inside the handler in

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