title: Changing a JMenuBar's font
body: <p>I have problems with setting the font of a <code>JMenuBar</code>. I personally don't like the bold font Java frames use by default, so I tried to change it by using something like this:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>public class MyFrame extends javax.swing.JFrame {
      public MyFrame() {
          JMenuBar menuBar = new JMenuBar();
          menuBar.setFont(new Font("sans-serif", Font.PLAIN, 12));
          setJMenuBar(menuBar);
          setSize(600, 400);
  
          // add some menus to the menu bar
          menuBar.add(new JMenu("Foo"));
          menuBar.add(new JMenu("Bar"));
          menuBar.add(new JMenu("Baz"));
          menuBar.add(new JMenu("Qux"));
  
          setVisible(true);
      }
  }
  </code></pre>
  
  <p>As far as I know, the line <code>menuBar.setFont(...)</code> sets the font used by the component menuBar. But when I instantiated one of these frames, the default font didn't change at all, not even when I put the font's size to 30.</p>
  
  <p>I appreciate any help concerning this. </p>