I need a little help with this code, I cannot get it right, and i know it is something simple that i am missing. Can someone help me out please.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;
import java.text.NumberFormat;

public class week2 extends JFrame implements ActionListener

//declaring fields for GUI
JTextField mortgageAmountField, interestRateField, yearsTermField, monthlyPayField;JButton monthButton;
JFrame frame;
int buttonCount = 0;
DecimalFormat fmt = new DecimalFormat("0.00");

//assigning labels to the fields
JLabel mortgageAmountLabel = new JLabel("Mortgage Amount:");
JLabel interestRateLabel = new JLabel("Interest Rate:");
JLabel yearsTermLabel=new JLabel("Term (Years):");
JLabel monthlyPayLabel=new JLabel();

public week2()
//declaring the title of the program 
frame = new JFrame("Mortgage Calculator");

//declaring panels 1 and 2
JPanel Panel1 = new JPanel();
JPanel Panel2 = new JPanel();

//assigning buttons to the panels
mortgageAmountField = new JTextField(15);

interestRateField = new JTextField(5);

yearsTermField = new JTextField(5);

monthlyPayField = new JTextField(5);

monthButton = new JButton("Reset");

monthButton = new JButton("Exit");

//setting up the quit button for the user to calculate the program
monthButton = new JButton("Calculate");

//indicating the border layout of our frames
frame.getContentPane().add(Panel1, BorderLayout.NORTH);
frame.getContentPane().add(Panel2, BorderLayout.SOUTH);
frame.setSize(700, 100);



//activating the action event so the user's input is taken
public void actionPerformed(ActionEvent event){
if(event.getSource() == monthButton)

public void mortgageCalc1() {

double ortgageAmount=Double.parseDouble(mortgageAmountField.getText()); //O= Original amount of loan-hard coded
double interestRate=Double.parseDouble(interestRateField.getText()); //I=Interest rate-hard coded
double yearsTerm=Double.parseDouble(yearsTermField.getText()); //T=Term of loan- hard coded
double monthlyPay = (mortgageAmount*(interestRate / 12))/ (1 - (Math.pow(1 / (1 + (interestRate / 12)), yearsTerm))); 

mortgageCalc1 = new mortgageCalc1(this);

//display the monthly payment 
monthlyPayLabel.setText("Your Monthly Payment will be: " + fmt.format(monthlyPay)); 

//continue with button actionlistener 


public static void main(String[] args)
week2 cal = new week2();

//end of programming

You have 2 JFrames!

Can you point that out for me, I do not see it.

Does your IDE have a Search? Try looking for where there is definition of a JFrame.
Does the main class extend JFrame?

I do have the search and I see the instances of JFrame, but I am still not sure which one is causing the issue, can someone explain it and point out what the problem is so i can correct it and not do it again.

1st way: Create a class Week that is derived from another class (here JFrame)
Week is now a subclass of JFrame class
public class Week2 extends JFrame{

2nd way: Create a class Week that is derived by default from Object
public class Week1 {
And in this class create field JFrame frame;

Which strategy you want to select?

some info: