1

In my Java app I use the following code when the main frame is initialized to override the default "About" dialog behavior on MacOS (see here for the Apple extensions).

Application a = Application.getApplication();
    a.setAboutHandler(new AboutHandler() {

        @Override
        public void handleAbout(AppEvent.AboutEvent arg0)
        {
            AboutDialog ad = new AboutDialog(EditorFrame.this, true);
            ad.setLocationRelativeTo(null);
            ad.setVisible(true);
        }

       });

When running the application from the command line:

java -Xdock:name="MyApp" -Dapple.laf.useScreenMenuBar=true -jar myapp.jar

Selecting MyApp->About from the menu give the default about screen. Alternatively, when running from inside of NetBeans the custom AboutDialog is displayed. Is there a specific command line argument I need to pass to the Java runtime to enable the use of the Apple Java extensions?

Cameron Hotchkies
  • 1,509
  • 1
  • 13
  • 20
  • After cleaning and rebuilding a few times, it now appears to be working correctly, this may be a issue specific to my build environment. – Cameron Hotchkies Apr 07 '12 at 22:05

0 Answers0