title: JFrame not appearing in Netbeans
body: <p>I have written a simple java application that squares and roots a number depending on the clicked button. Once I run it, the console displays that the build was successful but nothing is shown. Here's my code:</p>
  
  <pre><code>package lab11;
  
  import java.awt.*;
  import java.awt.event.*;
  import javax.swing.*;
  
  
  public class Problem1 extends JFrame implements ActionListener {
  
  int n;
  JTextField enter;
  JTextField result;
  JButton sqrt;
  JButton square;
  JLabel l1;
  JLabel l2;
  
  public static void main(String[] args){
      Problem1 exercice = new Problem1();
      exercice.setSize(500, 500);
      exercice.setVisible(true);
      exercice.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      exercice.show(true);
  }
  
  public Problem1(){
  
      super("Square Root");
      setLayout(new GridLayout(3,2));
      l1 = new JLabel("Enter N:");
      l2 = new JLabel("Result:");
      sqrt = new JButton("SQRT");
      square = new JButton("SQUARE");
      square.addActionListener(this);
      sqrt.addActionListener(this);
      n = Integer.parseInt(enter.getText());
      add(l1);
      add(enter);
      add(l2);
      add(result);
      add(sqrt);
      add(square);
  
  }
  
  @Override
  public void actionPerformed(ActionEvent e) {
      if(e.getSource() == square)
          result.setText(String.valueOf(n*n));
      if(e.getSource()== sqrt)
          result.setText(String.valueOf(Math.sqrt(n)));
  
  }
  
  }
  </code></pre>