title: Java Swing JFrame size different after upgrade to JRE11 from JRE 7 or 8. How can I make the frame size consistent?
body: <p>I help maintain a large, very old Swing project.  We noticed that the swing project pages running under JRE 11 look quite a bit different from the swing project running under JRE 8, our previous version.</p>
  <p>I have been exploring this issue.  One thing I noticed is that basic sizing seems to be different.  JRE11 makes all the JFrames larger.  We need to have the sizing stay consistent.</p>
  <p>Here is a small program to demonstrate what I am seeing:</p>
  <pre><code>    import javax.swing.*;
  
  public class JustAFrame
  {
      public static void main(String[] args)
      {
          SwingUtilities.invokeLater(
                  () -&gt; {
                      JFrame frame = new JFrame();
                      frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );
                      frame.pack();
                      frame.setSize(400, 500);
                      frame.setVisible(true);
                  });
      }
  }
  </code></pre>
  <p>I ran this program on the same Windows 10 machine using java 64 bit version jdk1.8.0_241 and
  zulu11.41.23-ca-fx-jdk11.0.8-win_x64.
  I'm attaching an image showing the same class running in the two java versions side by side.  The JRE 11 version appears to be about 50% larger.
  What can I do to make the JRE 11 JVM make our JFrames the size as our previous version of java, without having to go into every JFrame instance in our application and fiddling with the size Dimension parameter?</p>
  <p><a href="https://i.stack.imgur.com/aj6dj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aj6dj.png" alt="enter image description here" /></a></p>