1

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?

Uko
  • 13,134
  • 6
  • 58
  • 106

2 Answers2

1

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

  • Thank you for reply! Yes, **Apple Application Menu** was turned of, but when I turn it on - nothing changes (made clean build).**Window System API** was turned on. Also I don't have `/etc/netbeans.conf` file at all. Should I create it? By the way, IDE's menubar is showing right. Maybe I can check some logs? – Uko Feb 12 '12 at 19:49
  • The etc/netbeans.conf is created in your application directory when you install it. –  Feb 14 '12 at 13:38
1

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");
    }
}
Eelke
  • 20,897
  • 4
  • 50
  • 76
  • But the page behind the link you've posted says that **Screen Menu Bar** is done (green tick). If it's so, have you any idea if I can use JDK7 from http://jdk7.java.net/macportpreview/ or I need to get some latest code and compile it by myself? – Uko Feb 12 '12 at 21:05