title: how to call a public class to display gui in java using jformdesigner
body: <p>I wish to display my gui in the main method however it doesn't seem to do so...
  I've used the suggestion here:
  <a href="https://stackoverflow.com/questions/5971882/jformdesigner-design-it-wont-display">jformdesigner design it won&#39;t display?</a></p>
  
  <p>But that did not work,</p>
  
  <p>My error at the moment is that eclipse is suggesting I need to create a method called setDefaultCloseOperation which is already defined in the class and the same for the setvisible.</p>
  
  <p>"The method setDefaultCloseOperation(int) is undefined for the type bmicalc</p>
  
  <p>The method setVisible(boolean) is undefined for the type bmicalc"</p>
  
  <p>main method:</p>
  
  <pre><code>import java.awt.Container;
  import java.awt.GridLayout;
  import javax.swing.JFrame;
  import javax.swing.WindowConstants;
  
  public class iu {
  public static void main(String[] args) {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              bmicalc GUI = new bmicalc();
              GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              GUI.setVisible(true);
          }
      });
  class bmicalc extends JFrame{
  
  public bmicalc() {
      initComponents();
  
  }
  private void initComponents() {
      JFrame bmiCalculatorFrame = new JFrame();
      {
          bmiCalculatorFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          bmiCalculatorFrame.setTitle("BMI Calculator");
          Container bmiCalculatorFrameContentPane = bmiCalculatorFrame.getContentPane();
          bmiCalculatorFrameContentPane.setLayout(new GridLayout());
      }
  }}}}
  </code></pre>