Cameron Hotchkies
Cameron Hotchkies

Reputation: 1509

Why is Application.aboutHandler() not being called when run from the command line?

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?

Upvotes: 1

Views: 170

Answers (0)

Related Questions