title: How to completely remove an icon from JDialog?
body: <p>I am creating a dialog for showing a progress of files' copying. What I want to do is to completely remove dialog's icon image.</p>
  
  <p>I created such kind of dialogs before providing an application's instance of <code>FrameView</code> as an argument for <code>JDialog</code>'s constructor like this:</p>
  
  <pre><code>public class MyAppView extends FrameView {
  
      // ...
  
      @Action
      public void showOptionsDialog() {
  
          // Creating modal options' dialog
          JDialog optionsDialog = new JDialog(this, true);
  
          // ...
      }
  }
  </code></pre>
  
  <p>So, as I can see, I need a parent component to make my dialog with no icon. In my current case (when I have no parent frame view) I tried the following hack method setting a transparent icon but it doesn't work as I expect - I still see an empty area for an icon in dialog's title bar and (what's the worst) I still have a popup window when I click this area.</p>
  
  <pre><code>JFrame dummyFrame = new JFrame();
  Image icon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE);
  dummyFrame.setIconImage(icon);
  JDialog myDialog = new JDialog(dummyFrame, true);
  </code></pre>
  
  <p>Anyway, it must be possible to remove an icon. The working example is <a href="http://www.java2s.com/Tutorial/Java/0240__Swing/0960__JOptionPane-Dialog.htm" rel="nofollow">JOptionPane</a>:</p>
  
  <pre><code>JOptionPane.showMessage(null, "My message");
  </code></pre>
  
  <p>Looking at <code>JOptionPane</code>'s source code one can find that static <code>Frame JOptionPane.getRootFrame()</code> is used to get a parent for the calls when parent component is set to <code>null</code>:</p>
  
  <pre><code>public static Frame getRootFrame() throws HeadlessException {
      Frame sharedFrame = 
          (Frame)SwingUtilities.appContextGet(sharedFrameKey);
      if (sharedFrame == null) {
          sharedFrame = SwingUtilities.getSharedOwnerFrame();
          SwingUtilities.appContextPut(sharedFrameKey, sharedFrame);
      }
      return sharedFrame;
  }
  </code></pre>
  
  <p>So I've also tried to create my dialog as follows:</p>
  
  <pre><code>JDialog myDialog = new JDialog(JOptionPane.getRootFrame(), true);
  </code></pre>
  
  <p>but there is still no success. I have a standard Java icon when I try to apply this code snippet.</p>
  
  <p>And my question is: what am I doing wrong? <strong>How to completely remove an icon of <code>JDialog</code> as it is done by <code>JOptionPane</code>?</strong></p>
  
  <p>P.S. I use JDK6.</p>