title: Get actual JFrame size in swing after packing it
body: <p>I've created <code>JFrame</code> and set its size to <code>800x600</code>:</p>
  
  <pre><code>frame.setSize(800, 600);
  </code></pre>
  
  <p>Then I've created <code>JPanel</code> and inserted it in my <code>JFrame</code>:</p>
  
  <pre><code>JPanel panel = new JPanel();
  frame.add(panel, BorderLayout.CENTER);
  </code></pre>
  
  <p>But it's actual dimensions are less then <code>JFrame</code> dimensions, because of title bar and frame border heights, which vary in different operating systems.</p>
  
  <hr>
  
  <p>Then I've tried one more approach.</p>
  
  <p>I've created frame without setting its size.</p>
  
  <p>And after that I've created <code>JPanel</code> and set its preferred size:</p>
  
  <pre><code>panel.setPreferredSize(new Dimension(800, 600));
  </code></pre>
  
  <p>Then I've packed my <code>Jframe</code> with:</p>
  
  <pre><code>frame.pack();
  </code></pre>
  
  <hr>
  
  <p>How can I determine actual <code>JFrame</code> size now?</p>