Domanda

I'm building app in Netbeans Platform 7.1, and the problem is that the menu bar is in the window and not on the top of the desktop, when I run it on Mac OS (Lion).

Where can be the problem?

È stato utile?

Soluzione

You will either have to switch back to Java 6 so you can use Apple's implementation or you will have to be patient for OpenJDK to be complete their port.

Edit: Installed the latest macportpreview of OpenJDK 1.7. But my netbeans platform based application still wasn't using the apple menubar. Then made a small Swing application and it did use the apple menu bar. So it is possible. Tried several things with the netbeans.conf in several locations but didn't help. However the following did work. In one of the core modules in my netbeans platform application I allready had a ModuleInstaller. So I changed the restored function to contain the following lines:

@Override
public void restored() {
    if (System.getProperty("os.name").equals("Mac OS X")) {
        System.setProperty("apple.laf.useScreenMenuBar", "true");
    }
}

Altri suggerimenti

Make sure that:

a) -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true are included in the "etc/netbeans.conf" settings file. That makes the platform to place the menu correctly.

b) You're including the "Apple Application Menu" module inside the "platform" cluster, along with the "Window System API" and their dependencies.

Cheers, Antonio

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top