title: Java can't call simple JDialog built using eclipse WindowBuilder
body: <p>I'm trying to make a custom JDialog using windowBuilder, but at the very beginning I faced some issues. So here they are:</p>
  
  <p>I created simple Jdialog using windowBuilder. Here it's code:</p>
  
  <pre><code>public class GroupFrame extends JDialog {
  
      private final JPanel contentPanel = new JPanel();
  
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
          try {
              GroupFrame dialog = new GroupFrame();
              dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
              dialog.setVisible(true);
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
      /**
       * Create the dialog.
       */
      public GroupFrame() {
          setBounds(100, 100, 450, 300);
          getContentPane().setLayout(new BorderLayout());
          contentPanel.setLayout(new FlowLayout());
          contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
          getContentPane().add(contentPanel, BorderLayout.CENTER);
          {
              JPanel buttonPane = new JPanel();
              buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
              getContentPane().add(buttonPane, BorderLayout.SOUTH);
              {
                  JButton okButton = new JButton("OK");
                  okButton.setActionCommand("OK");
                  buttonPane.add(okButton);
                  getRootPane().setDefaultButton(okButton);
              }
              {
                  JButton cancelButton = new JButton("Cancel");
                  cancelButton.setActionCommand("Cancel");
                  buttonPane.add(cancelButton);
              }
          }
      }
  
  }
  </code></pre>
  
  <p>But then I want to change <strong>public static void main(String[] args)</strong> to something like <strong>public void show()</strong>. </p>
  
  <p>The new show() method code is:</p>
  
  <pre><code>public void show() {
          try {
              GroupFrame dialog = new GroupFrame();
              dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
              dialog.setVisible(true);
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>So when I'm triyng to call this changed method using the following code:  </p>
  
  <pre><code>GroupFrame groupFrame = new GroupFrame();
  groupFrame.show(); 
  </code></pre>
  
  <p>I've got the StackOverflowError (what a coincidence! ;D):</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
      at sun.awt.Win32GraphicsConfig.getBounds(Native Method)
      at sun.awt.Win32GraphicsConfig.getBounds(Unknown Source)
      at java.awt.Window.init(Unknown Source)
      at java.awt.Window.&lt;init&gt;(Unknown Source)
      at java.awt.Window.&lt;init&gt;(Unknown Source)
      at java.awt.Dialog.&lt;init&gt;(Unknown Source)
      at java.awt.Dialog.&lt;init&gt;(Unknown Source)
      at javax.swing.JDialog.&lt;init&gt;(Unknown Source)
      at javax.swing.JDialog.&lt;init&gt;(Unknown Source)
      at javax.swing.JDialog.&lt;init&gt;(Unknown Source)
      at UILayer.GroupFrame.&lt;init&gt;(GroupFrame.java:32)
      at UILayer.GroupFrame.show(GroupFrame.java:21)
      at java.awt.Component.show(Unknown Source)
      at java.awt.Component.setVisible(Unknown Source)
      at java.awt.Window.setVisible(Unknown Source)
      at java.awt.Dialog.setVisible(Unknown Source)
      at UILayer.GroupFrame.show(GroupFrame.java:23)
      at java.awt.Component.show(Unknown Source)
      at java.awt.Component.setVisible(Unknown Source)
      at java.awt.Window.setVisible(Unknown Source)
      at java.awt.Dialog.setVisible(Unknown Source)
      at UILayer.GroupFrame.show(GroupFrame.java:23)
      (etc...)
  </code></pre>
  
  <p>Could anybody point me on what I'm doing wrong?  </p>
  
  <p>Thanks in advance!</p>