title: Why is a JLabel in a JPopupMenu not respecting its Look and Feel?
body: <p>I have a Java application with a custom defined Look and Feel in which the user can switch between a light and a dark mode.  One of the things we have is a right click popup menu that inherits from the JPopupMenu class.  The first thing we add to the menu is a JLabel:</p>
  
  <pre><code>add( new JLabel( "&lt;html&gt;&lt;i&gt; " + field.desc + "&lt;/i&gt;&lt;br/&gt;field = " + field.getName() + "&lt;/html&gt;" ) );
  </code></pre>
  
  <p>Now, we have altered the L&amp;F for JLabels and they appear in quite a few places in the app styles correctly.  We have modified:</p>
  
  <pre><code>Label.background
  Label.foreground
  </code></pre>
  
  <p>Additionally, the L&amp;F for the MenuItems has also been modified via:</p>
  
  <pre><code>PopupMenu.border
  PopupMenu.foreground
  PopupMenu.background
  </code></pre>
  
  <p>For what it's worth, we've also modified similar properties on MenuItems.</p>
  
  <p>The problem is that that label that occurs inside the popup menu doesn't seem to be respecting the background color.  The foreground color changes when switching between light and dark mode, but the background color does not.  I did a screen grab and eyedropped the color that the background color was set to and couldn't find a match anywhere in our L&amp;F settings, which would seem to suggest that it was just using the default L&amp;F (Windows probably) on it.</p>
  
  <p>Is this perhaps a bug?  Or am I not setting some L&amp;F property I should be? I couldn't seem to find anybody in the Google-sphere with the same problem, so any help would be appreciated.</p>