title: Netbeans GUI preview is different from Runtime view
body: <p>I'm developing a simple Java application using NetBeans and its GUI editor.
  I'm stuck on creating a simple dialog: runtime it looks different from what I designed and from what is previewed in the editor.
  Basically, clicking on a button make my dialog appears.</p>
  
  <pre><code>    private void jButton1MouseReleased(java.awt.event.MouseEvent evt) {                                       
         PanelDialogNuovoCliente pan = new PanelDialogNuovoCliente();
         JDialog jd=new JDialog();
         jd.setTitle("Nuovo Cliente");
         jd.setMinimumSize(new Dimension(500, 400));
         jd.setLocationRelativeTo(null);
         jd.add(pan);
         jd.setModal(true);
         jd.setVisible(true);   
      }
  </code></pre>
  
  <p>The problem is that when the dialog appears it has a different look, the dialog window seems smaller and not all the components fit in it.</p>
  
  <p><code>PanelDialogNuovoCliente</code> is just a <code>JPanel</code> with some labels and <code>JTextField</code>.</p>
  
  <p>Maximum, Minimum and Preferred sizes are all set to (500,400) from the <code>JPanel</code> properties in the editor.</p>
  
  <p><code>JDialog</code> minimum size is set to (500,400) from the code that I snipped.</p>
  
  <p>Unfortunately I can't post a screenshot because I need at least 10 reputation but when I run the application Dialog's window is smaller compared to the one that I can see from the preview button in NetBean's GUI editor.</p>
  
  <p>EDIT: Here's the screenshot. Runtime JDialog is on the left, while preview of it in netbeans is on the right. I tried to call JDialog#pack() just before setVisible(true) without success. I set nimbus look and feel for my app. Anyways if i try to preview the design from ide with nimbus l&amp;f it looks perfect so i don't think that this one is the real problem
  <img src="https://i.stack.imgur.com/hvp9B.jpg" alt="enter image description here"></p>