how to add internal frame inside a jdialog
<p>i am using the following code :</p>

<pre><code>      JDialog d=new JDialog();
         JInternalFrame i=new JInternalFrame("HI",false,false,false,false);
       i.setPreferredSize(new Dimension(100,100));
     d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
     d.setTitle("Wait dialog");
    d.add(i);
     d.pack();
      d.setPreferredSize(new Dimension(100,100));
        d.setLocation(300,300);
    d.setAlwaysOnTop(true);
   d.setVisible(true);
</code></pre>

<p>but instead of getting a jdialog of size 100*100, i am getting a small window with the default width and height , why is this happening?
note: I did the same with a JFrame , and i got the result.But i want it on a JDialog.</p>

<p>Thanks in advance</p>
