2

JWrapper bundled OS-X no longer allows OS-X apps to display the menu bar at the top of the screen in true Apple style. Even when Apple look and feel for menu bar is specified with:

System.setProperty("apple.laf.useScreenMenuBar", "true");

or if jwrapper.xml file contains:

<JvmOptions>
    <JvmOption>-Xmx1024m</JvmOption>
    <JvmOption>-Dapple.laf.useScreenMenuBar=true</JvmOption>
</JvmOptions>

My test files is

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;

public class Main {

  static {
    System.setProperty("apple.laf.useScreenMenuBar", "true");
  }

  public static void main(String[] args) {
    JFrame frame = new JFrame("Menu Bar Demo");
    JMenuBar bar = new JMenuBar();
    JMenu fileMenu = new JMenu("File");
    JMenu editMenu = new JMenu("Edit");
    JMenu helpMenu = new JMenu("Help");
    bar.add(fileMenu);
    bar.add(editMenu);
    bar.add(helpMenu);
    frame.setSize(300, 150);
    frame.setJMenuBar(bar);
    frame.setVisible(true);
  }

}

My jwrapper command line (and jwrapper version) are:

java -jar jwrapper-00034804310.jar jwrapper.xml 

I am running on OS-X 10.9.5 and using Java 1.8.0_40 to build and run the app and also that is the version bundled with Jwrappered app

Michael Ellis
  • 243
  • 3
  • 14
  • Same issue here. Just wanted to add that I have the same issue on 10.10 and using the 1.7 JRE. Really annoying. – user3236716 Mar 29 '15 at 00:26
  • I am in correspondence with JWrapper who have thus far been unable to reproduce my problem, (So thanks @user3236716 for reporting that you have also found the problem) .Were you using the 1.7 JRE that came from Oracle or did you use the one distributed by JWrapper in their JRE download pack? – Michael Ellis Mar 30 '15 at 17:29
  • I used the 1.7 pack from you guys. I am using the actual app too if it makes any difference. – user3236716 Mar 31 '15 at 21:38
  • I have not had a reply from JWrapper so have re-sent my request today. This time I updated things with the latest jwrapper-00035090611.jar and the "Download JRE Pack 1.8" from the JWrapper site. – Michael Ellis May 11 '15 at 13:07
  • I have also discovered that the where my JWrappered HelloWorldApp-macos64-offline.dmg fails to place the menus in the correct place. The HelloWorldApp-macos32-offline.dmg DOES work correctly. – Michael Ellis May 11 '15 at 13:08
  • Example files available here: https://cloud.karyotyper.uk/index.php/s/EcUVvL0jfcuqvhe – Michael Ellis May 11 '15 at 13:12
  • I have the same problem with JRE 1.8, unfortunately running the 32-bit is not an option for me because it doesn't bundle the JRE, it uses the one provided by the system. – Gilberto Olimpio May 15 '15 at 07:16
  • The JRE version I'm having this issue is: 1.8.0_45 – Gilberto Olimpio May 15 '15 at 07:52
  • I received this reply from JWrapper: _Hi Michael, Thanks for reporting this. We have been able to reproduce this in a 1.8 JVM but it appears to work fine in a 1.7 JVM which would suggest it is some change in the JVM that is causing the problem. I will make a note for us to look into it in the future but I can't give a timeline for when it might be resolved. thanks Antony_ – Michael Ellis May 16 '15 at 08:27
  • As of 22-FEB-2016 this problem still persists. I have updated the example using wrapper-00041299173.jar and the JRE re-8u73. The entire self contained example can be found [here](https://owncloud.christopher-ellis.uk/index.php/s/uiZdoPvtWzrbH8K) – Michael Ellis Feb 22 '16 at 15:35

0 Answers0