title: How do I move my JMenuBar to the screen menu bar on Mac OS X?
body: <p>When I move my <code>JMenuBar</code> to the screen menu bar on Mac OS X, it leaves some blank space where the menu would be in my window; I need to remove that space. I am using </p>
  
  <pre><code>System.setProperty("apple.laf.useScreenMenuBar", "true")
  </code></pre>
  
  <p>to move my <code>JMenuBar</code> to the screen menu bar. My friend who uses a Mac reports that this leaves some ugly vertical space where the menu would reside if I did not set that property. What is the best way to resolve this issue?</p>
  
  <p>EDIT: Here is an example from my source:</p>
  
  <pre><code>public static void main(String[] args) {
      System.setProperty("apple.laf.useScreenMenuBar", "true");
      System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Name");
  
      JFrame frame = new JFrame("Gabby");
      final DesktopMain dm = new DesktopMain();
  
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.add(dm);
      frame.setSize(160, 144);
      frame.setLocationRelativeTo(null);
      frame.setIgnoreRepaint(true);
  
      JMenuBar menuBar = new JMenuBar();
      JMenu fileMenu = new JMenu("File");
      menuBar.add(fileMenu);
  
      // Populating the menu bar code goes here
  
      frame.setJMenuBar(menuBar);
      frame.setVisible(true);
  }
  </code></pre>