title: Receiving a number of errors from my Java program
body: <p>I've been trying to learn how to create a GUI Java program. I have been following a book to learn the process but despite me copying the book by the letter (to the best of my knowledge) I have been running into a number of issues. Here is my full code to start.</p>
  
  <pre><code>package healthprofilegui;
  
  //packages to be imported for the GUI
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JOptionPane;
  import javax.swing.JTextField;
  
  
  public class HealthProfileGUI extends JFrame implements ActionListener {
  
      // text field variables used to get user input.
      JTextField txtName = new JTextField(15);
      JTextField txtAge = new JTextField(15);
      JTextField txtWeight = new JTextField(15);
      JTextField txtHeight_feet = new JTextField(15);
      JTextField txtHeight_inches = new JTextField(15);
  
      //text field variables used to display calculations.
      JTextField txtBMI = new JTextField(15);
      JTextField txtCategory = new JTextField(15);
      JTextField txtMaxHeartRate = new JTextField(15);
  
      //buttons to be used for the program.
      JButton btnDisplay = new JButton("Display");
      JButton btnClear = new JButton("Clear");
  
      Integer heightTotal = null;
  
      private HealthProfile myProfile;
  
      public profileGUI()
      {
          super("HealthProfile");
          myProfile = new HealthProfile();
          setLayout(new GridLayout(0,2));
  
          //adds the text field labels to the program.
          add(new JLabel("txtName"));
          add(txtName);
          add(new JLabel("txtAge"));
          add(txtAge);
          add(new JLabel("txtWeight"));
          add(txtWeight);
          add(new JLabel("txtHeight_feet"));
          add(txtHeight_feet);
          add(new JLabel("txtHeight_inches"));
          add(txtHeight_inches);
  
  
          //adds the buttons to the program.
          add(btnDisplay);
          add(btnClear);
  
          //adds labels for the output fields
          add(new JLabel("txtBMI"));
          add(txtBMI);
          add(new JLabel("txtCategory"));
          add(txtCategory);
          add(new JLabel("txtMaxHeartRate"));
          add(txtMaxHeartRate);
  
          setVisible(true);
          btnDisplay.addActionListener(this);
          btnClear.addActionListener(this);
      }
  
  
  
      @Override
      public void action(ActionEvent e)
      {
          //clear text if the button is pressed.
          if(e.getSource() == btnClear)
          {
              System.out.println("Clear Pressed");
              txtName.setText("");
              txtAge.setText("");
              txtWeight.setText("");
              txtHeight_feet.setText("");
              txtHeight_inches.setText("");
              txtBMI.setText("");
              txtCategory.setText("");
              txtMaxHeartRate.setText("");
  
          }
  
          //process data if pressed.
          if(e.getSource() == btnDisplay)
          {
              //checks for missing input
              if (txtName.getText().isEmpty() || txtAge.getText().isEmpty() || txtWeight.getText().isEmpty() || txtHeight_feet.getText().isEmpty() || 
                      txtHeight_inches.getText().isEmpty())
              {
                  JOptionPane.showMessageDialog(null, "Please provide all input.");
                  return;
              }
  
              myProfile.setName(txtName.getText());
  
  
  
              try
              {
                  myProfile.setAge(Integer.parseInt(txtAge.getText()));
                  myProfile.setWeight(Integer.parseInt(txtWeight.getText()));
  
              }
              catch (NumberFormatException ex)
              {
                  JOptionPane.showMessageDialog(null, "Please enter a numeric value");
                  return;
              }
  
  
  
  
          }
      }
  
      public static void main(String[] args) {
  
      }
  
  }
  </code></pre>
  
  <p>The first error I am receiving for the class </p>
  
  <pre><code>public class HealthProfileGUI extends JFrame implements ActionListener
  </code></pre>
  
  <p>is <code>HealthProfileGUI</code> is not abstract and does not override abstract method <code>actionPerformed(ActionEvent)</code> in <code>ActionListener</code>.</p>
  
  <p>I'm not entirely certain why I'm receiving this error.</p>
  
  <p>The second/third is for a method i'm trying to use in order to set the layout for the GUI</p>
  
  <pre><code>public profileGUI()
  </code></pre>
  
  <p>is giving me the error</p>
  
  <pre><code>invalid method declaration; return type required
  </code></pre>
  
  <p>I have no idea why this appearing as the instructions never used a "return" in it.</p>
  
  <p>I'm also getting this error "call to super must be first statement in constructor"</p>
  
  <p>for </p>
  
  <pre><code>super("HealthProfile");
  </code></pre>
  
  <p>I have tried to find as much information to this error as possible but couldn't quite find anything that replicated my issue to a similar degree.</p>
  
  <p>The very last thing I'm having issues with is </p>
  
  <pre><code>@Override
  public void action(ActionEvent e)
  </code></pre>
  
  <p>method does not override or implement a method from a supertype</p>
  
  <p>I'm sorry that there is so much, I kept following the instructions as best I could with assumptions that the errors would sort themselves out after I finished placing all the code. However that is not so much the case.</p>
  
  <p>I greatly appreciate the assistance. Especially since this has been a huge handful for me.</p>