title: Why won't my Jbutton do anything on click?
body: <p>I've been trying to make it so my button will close out of the frame on click but it never does anything. I've looked through several stackoverflow threads but none of them seems to work on my this.. here is what I have so far</p>
  
  <pre><code>    JButton start = new JButton("Start");
      start.setBounds(251, 216, 119, 23);
  
      start.addActionListener(new ActionListener(){
  
          @Override
          public void actionPerformed(ActionEvent evt) {
  
              try {
                  int hpToEat = Integer.parseInt(GUI.textField.getText());
                  Frost.hp = hpToEat;
              } catch(NumberFormatException nfe) {
                  GUI.textField.setText("");
              }
              setVisible(false);
          }
      });
      contentPane.add(start);
  </code></pre>
  
  <p>I have tried making a closeFrame method which uses super.dispose(); and I've also tried system.exit(0);</p>
  
  <p>Does anyone have any idea as to why My button won't do What i want it to do? </p>
  
  <p>Someone requested the rest of my code so here it is:</p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.EventQueue;
  
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.border.EmptyBorder;
  import javax.swing.JLabel;
  import java.awt.Font;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import javax.swing.JCheckBox;
  import javax.swing.JTextField;
  import javax.swing.JButton;
  
  
  public class GUI extends JFrame{
  
  private JPanel contentPane;
  public static JTextField textField;
  
  
  /**
   * Launch the application.
   */
  public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
          public void run() {
              try {
                  GUI frame = new GUI();
                  frame.setVisible(true);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  }
  
  /**
   * Create the frame.
   */
  public GUI() {
  
      //LABELS ===================================================================================================
  </code></pre>