Error
.java:132: incompatible types
found : int
required: int[]
int[] months= numOfYears*12; //The variable used for user input for exact month information
^
1 error

Tool completed with exit code 1

public void actionPerformed(ActionEvent Mortgage) {													// Starts Mortgage Calculator
        DecimalFormat decimalPlaces=new DecimalFormat("0.00");
        appMonthlyPayment.setText("");

        // The next 3 lines get the values from the text boxes. - The only user entry will be principal for this version
        // term = Integer.parseInt(appTerm.getText());
        // interest = Double.parseDouble(appTerm.getText());
        principal = Double.parseDouble(appPrincipal.getText());


        //Calculate Monthly Interest
        double monthlyInterest = annualInterests[i]/(12*100);
        int totalNumOfMonths = numOfYears[i]*12;

        int[] months= numOfYears[i]*12; 	   		         //The variable used for user input for exact month information
        monthlyInterest = interest/(12 * 100);   //calculate the monthly interst using simple interest.
        double denominator= Math.pow(1 + monthlyInterest, -(numOfYears[i]*12));
        denominator= 1 - denominator;
        double monthlyPayment= principal * (monthlyInterest/ denominator);
	}
        public double getMortgageAmount(double principal, double monthlyInterest, int numOfMonths){
        // Monthly payment formula: M = P x (J/(1-(1+J)^-N));
        // M = P * ( J / (1 - (1 + J) ** -N));
        // source: http://www.hughchou.org/calc/formula.html
        double monthlyPayment= (double)(principal*(monthlyInterest / (1-(Math.pow((1+monthlyInterest),(numOfMonths*-1))))));
        return monthlyPayment;

        double getMonthlyPrincipal, remainingPrincipal;		//calculate the monthly interst using simple interest.

        return monthlyPayment - (remainingPrincipal * monthlyInterest);

        appMonthlyPayment.setText("Payment = " + monthlyPayment);			 // Finally, set the text field to show the result
    }																		 // Ends Mortgage Calculator

This isn't an array:

int[] months= numOfYears[i]*12; //The variable used for user input for exact month information

Shouldn't it be:

int[] months= numOfYears[i*12];

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.