title: JFrame gets decorated with Windows borders, even the Look&Feel is set otherwise
body: <p>Good day everyone.</p>
  <p>First of all: check this image.
  <a href="https://i.stack.imgur.com/ovRp7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ovRp7.png" alt="" /></a></p>
  
  <p>Please note that in the first of the 3 frames, the button is styled with Metal Look and Feel, but the frame is Windows styled. The other 2 frames are &quot;OK&quot; in the sence that the button LAF matches the frame LAF.</p>
  <p>The code for all of these (same order as the images):</p>
  <pre><code>public static void main(String[] args) {
  
      SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {             
              JFrame frame = new JFrame();
  
              frame.getContentPane().add(new JButton(&quot;button&quot;));
              frame.setVisible(true);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          }
      });
  }
  
  public static void main(String[] args) {
  
      SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {             
              JFrame frame = new JFrame();
  
              frame.setUndecorated(true);
              frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
              frame.setSize(100, 100); 
  
              frame.getContentPane().add(new JButton(&quot;button&quot;));
              frame.setVisible(true);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          }
      });
  }
  
  public static void main(String[] args) {
  
      SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
              try {
                  // 0 =&gt; &quot;javax.swing.plaf.metal.MetalLookAndFeel&quot;
                  // 3 =&gt; the Windows Look and Feel
                  String name = UIManager.getInstalledLookAndFeels()[3].getClassName();
                  UIManager.setLookAndFeel(name);
              } catch (Exception ex) {
                  ex.printStackTrace();
              }
              
              JFrame frame = new JFrame();
  
              frame.getContentPane().add(new JButton(&quot;button&quot;));
              frame.setVisible(true);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          }
      });
  }
  </code></pre>
  <p>Now what bothers me is that I have never been forced to use the lines <code>frame.setUndecorated(true); frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);</code>, as setting the Look and Feel just worked with the <code>UIManager.setLookAndFeel()</code> method. Normally, the JFrame itself would get styled too, but this seems not longer the case as I get a Windows styled frame (1st image, 1 code snippet).</p>
  <p>Why is this? Is this new in Java 7? This seems really weird.</p>
  <p>Normally, without touching code that involves Look and Feel, the program should start with the Metal Look and Feel, as this is the standard Java Look and Feel. So why does the first program start with a Windows frame?</p>