14 Replies - 9015 Views - Last Post: 22 August 2011 - 01:35 PM Rate Topic: -----

#1 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

I need help with Java programming!

Posted 21 August 2011 - 08:30 PM

I seem to be having difficulties in compiling my codes. Frankly I am still very new to Java and could use any help or advice. If you do help me, please explain it to me. Not asking anyone to do my homework, but just telling me how to do something and not explaining why won't help me learn and that is what I want to do. Learn.

Here is what I am attempting on doing: Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. Allow the user to loop back and enter new data or quit. Please insert comments in the program to document the program.

package mortgagecalc4;
import java.awt.;
import java.awt.event.;
import javax.swing.;
import javax.swing.text.;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;

public class Mortgagecalc4{


private static final int FRAME_WIDTH = 150;
private static final int FRAME_HEIGHT = 120;
	 
  // Keeps track of the current operation (subtract, add, etc)
private static final int Decline_Calculation = 0;
private static final int ADDITION = 1;
public static int Calculation = Decline_Calculation;
 
public static JTextField textFieldDisplay;
public static double Set1 = 0; // holds the value before the operation
    
    public static void main(String[] args) {
        // Set up the user interface
	        JFrame frame = new JFrame();
	        JPanel buttonSet = new JPanel();
	        frame.add(buttonSet);
	 
	        // create two buttons, plus and equal and a text box for answers
	        textFieldDisplay = new JTextField(10);
	        buttonSet.add(textFieldDisplay);
	        JButton buttoncalculate = new JButton(" MC ");
	        buttonSet.add(calculate);
	        JButton buttonpercent = new JButton(" % ");
	        buttonSet.add(percent);
	        JButton buttonequation = new JButton(" E ");
	        buttonSet.add(equation);
	        JButton buttonaddition = new JButton(" + ");
	        buttonSet.add(addition);
	        JButton buttonTotal = new JButton(" Total ");
	        buttonSet.add(total);
	        JButton.buttonsquareroot = new JButton(" ^ ");
	        buttonSet.add(squareroot);
	        JButton.buttondivide = new JButton(" / ");
	        buttonSet.add(divide);
	        JButton.buttonsubtract = new JButton(" - ");
	        buttonSet.add(subtract);
	        JButton.buttonequals = new JButton(" = ");
	        buttonSet.add(equals);
	        JButton.buttonstage = new JButton(" STG ");
	        buttonSet.add(stage);
	        JButton.buttonclear = new JButton(" CE ");
	        buttonSet.add(clear);
	        JButton.buttoninterest = new JButton(" interest ");
	        buttonSet.add(interest);
	        JButton.buttonaverage = new JButton(" average ");
	        buttonSet.add(average);
	        JButton.buttonbalance = new JButton(" balance ");
	        buttonSet.add(balance);
	        JButton.buttonsave = new JButton(" save ");
	        buttonSet.add(save);
	 
	 
	        // frame size the the calculator
	        frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
	        frame.setTitle("Mortgage Calculator");
	        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        frame.setVisible(true);
	 
	 
	        // called when the equal sign '=' is pressed
	        class EqualSignListener implements ActionListener {
	 
	            public void actionPerformed(ActionEvent event)
	            {
	                double Set2 = Double.parseDouble(textFieldDisplay.getText());
	                if (Calculation == ADDITION) {
	                    // plus sign pressed before the equal sign
	                    Set2 += Set1;
	                }
	                // Convert from a answer to a string
	                Double answer = new Double(Set2);
	                textFieldDisplay.setText( answer.toString() );
	                // Reset the operation to show no current operation
	                Calculation = Decline_Calculation;
	            }
	        }
	 
	        // called when a plus sign '+' is pressed
	        class PlusSignListener implements ActionListener {
            @Override
	            public void actionPerformed(ActionEvent event)
	            {
	                Set1 = Double.parseDouble(textFieldDisplay.getText());
	                Calculation = ADDITION;
	            }
	        }
	 
	        // Add the methods that will be called when these buttons are pressed
	        ActionListener AdditionSignListener = new AdditionSignListener();
	        buttonaddition.addActionListener(AdditionSignListener);
	 
	        ActionListener equalSignListener = new EqualSignListener();
	        buttonequals.addActionListener(equalSignListener);
	 
	 
	 
	{
public static void(String[] args) throws IOException
	    {
	        //Declare variable for loan amount
                double LoanAmt = 200000;
	        double Principle1, Principle2, Principle3;
	        double Payments1, Payments2, Payments3;// creates variable for three different payment amounts
	        double Monthlyinterest1, Monthlyinterest2, Monthlyinterest3; //creates variables for three differene interest amounts
	        double Monthlyprinciple1, Monthlyprinciple2, Monthlyprinciple3; //creates variables for three different principal paymentamounts
	        Principle1 = LoanAmt;
	        Principle2 = LoanAmt;
	        Principle3 = LoanAmt;
	        Monthlyprinciple1 = 0;
	        Monthlyprinciple2 = 0;
	        Monthlyprinciple3 = 0;
	        Monthlyinterest1 = 0;
	        Monthlyinterest2 = 0;
	        Monthlyinterest3 = 0;
	        int Count = 1;
	 
	 
	 
	 
	        //create loan term array
	        double [] Term = {84, 180, 360};
	 
	        //create interest rate array
	        double [] Rate = {.0535, .055, .0575};
	 
	        //calculations for each payment amount
	        Payments1 = (LoanAmt * Rate[0]/12) / (1-Math.pow(1+Rate[0]/12,-Term[0]));
	        Payments2 = (LoanAmt * Rate[1]/12) / (1-Math.pow(1+Rate[1]/12,-Term[1]));
	        Payments3 = (LoanAmt * Rate[2]/12) / (1-Math.pow(1+Rate[2]/12,-Term[2]));
	 
	        //output
	        System.out.println("\t\tMonthly Payment Schedule");
	        System.out.println();
	        System.out.println("\t\tLoan Amount: $200,000.00");
	        System.out.println("\t\tTerm: 7 Years");
	        System.out.println("\t\tInterest Rate 5.35%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments1);
	        System.out.println();
	        System.out.println("\t\tTerm: 15 Years");
	        System.out.println("\t\tInterest Rate 5.5%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments2);
	        System.out.println();
	        System.out.println("\t\tTerm: 30 Years");
	        System.out.println("\t\tInterest Rate 5.75%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments3);
	        System.out.println();
	 
	 
	 
	 
	 
	 
	        if (Principle1 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest1 =        (Principle1 * Rate[0]) / 365 * 30;
	                Monthlyprinciple1 =  (Payments1 - Monthlyinterest1);
	                Principle1 =       (Principle1 - Monthlyprinciple1);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest1);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple1);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle1);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle2 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest2 =        (Principle2 * Rate[0]) / 365 * 30;
	                Monthlyprinciple2 =  (Payments2 - Monthlyinterest2);
	                Principle2 =       (Principle2 - Monthlyprinciple2);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest2);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple2);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle2);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle3 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest3 =        (Principle3 * Rate[0]) / 365 * 30;
	                Monthlyprinciple3 =  (Payments3 - Monthlyinterest3);
	                Principle3 =       (Principle3 - Monthlyprinciple3);
	                if (Principle2 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest3);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple3);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle3);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	 
	        }
	 
	        System.exit(0);
	    }
	}
    




Here is the errors I am getting.


C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:3: <identifier> expected
import java.awt.;
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:4: <identifier> expected
import java.awt.event.;
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:5: <identifier> expected
import javax.swing.;
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:6: <identifier> expected
import javax.swing.text.;
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: illegal start of expression
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: illegal start of expression
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: ';' expected
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: ')' expected
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: not a statement
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: ';' expected
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: not a statement
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:132: ';' expected
public static void(String[] args) throws IOException
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:264: reached end of file while parsing
}
^
13 errors
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\nbproject\build-impl.xml:603: The following error occurred while executing this line:
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\nbproject\build-impl.xml:245: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 seconds)


Once again thank you so much for your help. I can't thank you enough. This is hard for me to learn, but I am hoping with your help and guidance I will pick it up.

Is This A Good Question/Topic? 0
  • +

Replies To: I need help with Java programming!

#2 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 21 August 2011 - 08:52 PM

Look at your imports: like
 import java.awt.;
import javax.swing.;
There is no dot at the end of imports, you have to complete your imports like import java.awt.Button; or atleast import java.awt.*; and so on to others.
What you are doing here is importing a specific class in awt(the first one, here is Button) or by saying .* means everything in awt

This post has been edited by smohd: 21 August 2011 - 08:58 PM

Was This Post Helpful? 3
  • +
  • -

#3 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10397
  • View blog
  • Posts: 38,475
  • Joined: 27-December 08

Re: I need help with Java programming!

Posted 21 August 2011 - 08:53 PM

Moved to Java.
Was This Post Helpful? 0
  • +
  • -

#4 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 21 August 2011 - 08:57 PM

Also this line
public static void(String[] args) throws IOException
There is no method name here it must be something like
public static void methodName(String[] args) throws IOException{

This post has been edited by smohd: 21 August 2011 - 08:59 PM

Was This Post Helpful? 1
  • +
  • -

#5 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

Re: I need help with Java programming!

Posted 21 August 2011 - 09:07 PM

View Postsmohd, on 21 August 2011 - 08:52 PM, said:

Look at your imports: like
 import java.awt.;
import javax.swing.;
There is no dot at the end of imports, you have to complete your imports like import java.awt.Button; or atleast import java.awt.*; and so on to others.
What you are doing here is importing a specific class in awt(the first one, here is Button) or by saying .* means everything in awt



Thank you. I fixed the imports like you said, although I didn't know what to put so I just added the * behind the ones red lined. But I am still getting 9 errors and its seems to be centered around the
public static void (String[] args) throws IOException
Thanks!!!
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10397
  • View blog
  • Posts: 38,475
  • Joined: 27-December 08

Re: I need help with Java programming!

Posted 21 August 2011 - 09:08 PM

View Postsmohd, on 21 August 2011 - 11:57 PM, said:

Also this line
public static void(String[] args) throws IOException
There is no method name here it must be something like
public static void methodName(String[] args) throws IOException{

smohd already answered this. Your method must have a name. :)
Was This Post Helpful? 2
  • +
  • -

#7 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

Re: I need help with Java programming!

Posted 22 August 2011 - 09:47 AM

I was able to figure out the method name problem but I am left now with more errors. Here is the code. Can someone please explain to me what these errors mean? Thank you again.

package mortgagecalc4;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.Container.*;
import java.awt.Dimension.*;
import java.awt.FlowLayout.*;
import java.awt.GridLayout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.text.DecimalFormat.*;
import java.text.NumberFormat.*;
import java.util.Locale.*;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;

public class Mortgagecalc4{


private static final int FRAME_WIDTH = 150;
private static final int FRAME_HEIGHT = 120;
	 
  // Keeps track of the current operation (subtract, add, etc)
private static final int Decline_Calculation = 0;
private static final int ADDITION = 1;
public static int Calculation = Decline_Calculation;
 
public static JTextField textFieldDisplay;
public static double Set1 = 0; // holds the value before the operation
    
    public static void main(String[] args) {
        // Set up the user interface
	        JFrame frame = new JFrame();
	        JPanel buttonSet = new JPanel();
	        frame.add(buttonSet);
	 
	        // create two buttons, plus and equal and a text box for answers
	        textFieldDisplay = new JTextField(10);
	        buttonSet.add(textFieldDisplay);
	        JButton buttoncalculate = new JButton(" MC ");
	        buttonSet.add(calculate);
	        JButton buttonpercent = new JButton(" % ");
	        buttonSet.add(percent);
	        JButton buttonequation = new JButton(" E ");
	        buttonSet.add(equation);
	        JButton buttonaddition = new JButton(" + ");
	        buttonSet.add(addition);
	        JButton buttonTotal = new JButton(" Total ");
	        buttonSet.add(total);
	        JButton.buttonsquareroot = new JButton(" ^ ");
	        buttonSet.add(squareroot);
	        JButton.buttondivide = new JButton(" / ");
	        buttonSet.add(divide);
	        JButton.buttonsubtract = new JButton(" - ");
	        buttonSet.add(subtract);
	        JButton.buttonequals = new JButton(" = ");
	        buttonSet.add(equals);
	        JButton.buttonstage = new JButton(" STG ");
	        buttonSet.add(stage);
	        JButton.buttonclear = new JButton(" CE ");
	        buttonSet.add(clear);
	        JButton.buttoninterest = new JButton(" interest ");
	        buttonSet.add(interest);
	        JButton.buttonaverage = new JButton(" average ");
	        buttonSet.add(average);
	        JButton.buttonbalance = new JButton(" balance ");
	        buttonSet.add(balance);
	        JButton.buttonsave = new JButton(" save ");
	        buttonSet.add(save);
	 
	 
	        // frame size the the calculator
	        frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
	        frame.setTitle("Mortgage Calculator");
	        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        frame.setVisible(true);
	 
	 
	        // called when the equal sign '=' is pressed
	        class EqualSignListener implements ActionListener {
	 
            @Override
	            public void actionPerformed(ActionEvent event)
	            {
	                double Set2 = Double.parseDouble(textFieldDisplay.getText());
	                if (Calculation == ADDITION) {
	                    // plus sign pressed before the equal sign
	                    Set2 += Set1;
	                }
	                // Convert from a answer to a string
	                Double answer = new Double(Set2);
	                textFieldDisplay.setText( answer.toString() );
	                // Reset the operation to show no current operation
	                Calculation = Decline_Calculation;
	            }
	        }
	 
	        // called when a plus sign '+' is pressed
	        class PlusSignListener implements ActionListener {
            @Override
	            public void actionPerformed(ActionEvent event)
	            {
	                Set1 = Double.parseDouble(textFieldDisplay.getText());
	                Calculation = ADDITION;
	            }
	        }
	 
	        // Add the methods that will be called when these buttons are pressed
	        ActionListener AdditionSignListener = new AdditionSignListener();
	        buttonaddition.addActionListener(AdditionSignListener);
	 
	        ActionListener equalSignListener = new EqualSignListener();
	        buttonequals.addActionListener(equalSignListener);
	 
	        //Declare variable for loan amount
                double LoanAmt = 200000;
	        double Principle1, Principle2, Principle3;
	        double Payments1, Payments2, Payments3;// creates variable for three different payment amounts
	        double Monthlyinterest1, Monthlyinterest2, Monthlyinterest3; //creates variables for three differene interest amounts
	        double Monthlyprinciple1, Monthlyprinciple2, Monthlyprinciple3; //creates variables for three different principal paymentamounts
	        Principle1 = LoanAmt;
	        Principle2 = LoanAmt;
	        Principle3 = LoanAmt;
	        Monthlyprinciple1 = 0;
	        Monthlyprinciple2 = 0;
	        Monthlyprinciple3 = 0;
	        Monthlyinterest1 = 0;
	        Monthlyinterest2 = 0;
	        Monthlyinterest3 = 0;
	        int Count = 1;
	 
	 
	 
	 
	        //create loan term array
	        double [] Term = {84, 180, 360};
	 
	        //create interest rate array
	        double [] Rate = {.0535, .055, .0575};
	 
	        //calculations for each payment amount
	        Payments1 = (LoanAmt * Rate[0]/12) / (1-Math.pow(1+Rate[0]/12,-Term[0]));
	        Payments2 = (LoanAmt * Rate[1]/12) / (1-Math.pow(1+Rate[1]/12,-Term[1]));
	        Payments3 = (LoanAmt * Rate[2]/12) / (1-Math.pow(1+Rate[2]/12,-Term[2]));
	 
	        //output
	        System.out.println("\t\tMonthly Payment Schedule");
	        System.out.println();
	        System.out.println("\t\tLoan Amount: $200,000.00");
	        System.out.println("\t\tTerm: 7 Years");
	        System.out.println("\t\tInterest Rate 5.35%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments1);
	        System.out.println();
	        System.out.println("\t\tTerm: 15 Years");
	        System.out.println("\t\tInterest Rate 5.5%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments2);
	        System.out.println();
	        System.out.println("\t\tTerm: 30 Years");
	        System.out.println("\t\tInterest Rate 5.75%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments3);
	        System.out.println();
	 
	 
	 
	 
	 
	 
	        if (Principle1 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest1 =        (Principle1 * Rate[0]) / 365 * 30;
	                Monthlyprinciple1 =  (Payments1 - Monthlyinterest1);
	                Principle1 =       (Principle1 - Monthlyprinciple1);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest1);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple1);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle1);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle2 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest2 =        (Principle2 * Rate[0]) / 365 * 30;
	                Monthlyprinciple2 =  (Payments2 - Monthlyinterest2);
	                Principle2 =       (Principle2 - Monthlyprinciple2);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest2);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple2);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle2);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle3 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest3 =        (Principle3 * Rate[0]) / 365 * 30;
	                Monthlyprinciple3 =  (Payments3 - Monthlyinterest3);
	                Principle3 =       (Principle3 - Monthlyprinciple3);
	                if (Principle2 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest3);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple3);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle3);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	 
	        }
	 
	        System.exit(0);
	    }
	}



Errors:


C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:56: cannot find symbol
symbol : variable calculate
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(calculate);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:58: cannot find symbol
symbol : variable percent
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(percent);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:60: cannot find symbol
symbol : variable equation
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(equation);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:62: cannot find symbol
symbol : variable addition
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(addition);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:64: cannot find symbol
symbol : variable total
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(total);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:65: cannot find symbol
symbol : variable buttonsquareroot
location: class javax.swing.JButton
JButton.buttonsquareroot = new JButton(" ^ ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:66: cannot find symbol
symbol : variable squareroot
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(squareroot);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:67: cannot find symbol
symbol : variable buttondivide
location: class javax.swing.JButton
JButton.buttondivide = new JButton(" / ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:68: cannot find symbol
symbol : variable divide
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(divide);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:69: cannot find symbol
symbol : variable buttonsubtract
location: class javax.swing.JButton
JButton.buttonsubtract = new JButton(" - ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:70: cannot find symbol
symbol : variable subtract
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(subtract);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:71: cannot find symbol
symbol : variable buttonequals
location: class javax.swing.JButton
JButton.buttonequals = new JButton(" = ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:72: cannot find symbol
symbol : variable equals
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(equals);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:73: cannot find symbol
symbol : variable buttonstage
location: class javax.swing.JButton
JButton.buttonstage = new JButton(" STG ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:74: cannot find symbol
symbol : variable stage
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(stage);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:75: cannot find symbol
symbol : variable buttonclear
location: class javax.swing.JButton
JButton.buttonclear = new JButton(" CE ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:76: cannot find symbol
symbol : variable clear
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(clear);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:77: cannot find symbol
symbol : variable buttoninterest
location: class javax.swing.JButton
JButton.buttoninterest = new JButton(" interest ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:78: cannot find symbol
symbol : variable interest
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(interest);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:79: cannot find symbol
symbol : variable buttonaverage
location: class javax.swing.JButton
JButton.buttonaverage = new JButton(" average ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:80: cannot find symbol
symbol : variable average
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(average);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:81: cannot find symbol
symbol : variable buttonbalance
location: class javax.swing.JButton
JButton.buttonbalance = new JButton(" balance ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:82: cannot find symbol
symbol : variable balance
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(balance);
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:83: cannot find symbol
symbol : variable buttonsave
location: class javax.swing.JButton
JButton.buttonsave = new JButton(" save ");
^
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\src\mortgagecalc4\Mortgagecalc4.java:84: cannot find symbol
symbol : variable save
location: class mortgagecalc4.Mortgagecalc4
buttonSet.add(save);
^
25 errors
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\nbproject\build-impl.xml:603: The following error occurred while executing this line:
C:\Users\Falloncade\Documents\NetBeansProjects\mortgagecalc4\nbproject\build-impl.xml:245: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
Was This Post Helpful? 0
  • +
  • -

#8 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 22 August 2011 - 09:54 AM

Look at this part of code:
textFieldDisplay = new JTextField(10);
	        buttonSet.add(textFieldDisplay);
	        JButton buttoncalculate = new JButton(" MC ");
	        buttonSet.add(calculate);
	        JButton buttonpercent = new JButton(" % ");
	        buttonSet.add(percent);
	        JButton buttonequation = new JButton(" E ");
	        buttonSet.add(equation);
	        JButton buttonaddition = new JButton(" + ");
	        buttonSet.add(addition);
	        JButton buttonTotal = new JButton(" Total ");
	        buttonSet.add(total);
	        JButton.buttonsquareroot = new JButton(" ^ ");
	        buttonSet.add(squareroot);
	        JButton.buttondivide = new JButton(" / ");
	        buttonSet.add(divide);
	        JButton.buttonsubtract = new JButton(" - ");
	        buttonSet.add(subtract);
	        JButton.buttonequals = new JButton(" = ");
	        buttonSet.add(equals);
	        JButton.buttonstage = new JButton(" STG ");
	        buttonSet.add(stage);
	        JButton.buttonclear = new JButton(" CE ");
	        buttonSet.add(clear);
	        JButton.buttoninterest = new JButton(" interest ");
	        buttonSet.add(interest);
	        JButton.buttonaverage = new JButton(" average ");
	        buttonSet.add(average);
	        JButton.buttonbalance = new JButton(" balance ");
	        buttonSet.add(balance);
	        JButton.buttonsave = new JButton(" save ");
	        buttonSet.add(save);


You have a lot of undeclared variable, you declare buttoncalculate and then use it as calculate!!!
Was This Post Helpful? 1
  • +
  • -

#9 RobW1985  Icon User is offline

  • New D.I.C Head

Reputation: 14
  • View blog
  • Posts: 38
  • Joined: 22-June 11

Re: I need help with Java programming!

Posted 22 August 2011 - 09:59 AM

when you add buttons you must specifically add the correct button name, look at your code on these two lines
JButton buttonpercent = new JButton(" % ");
buttonSet.add(percent);



Your adding a button called percent on the second line but on the first line you create a button called buttonPercent. The error cannot find symbol means it can't locate the item your trying to use, in this case "percent", which it won't be able to because you didn't create one. You created a button called buttonpercent, so when you add the button you need to add "buttonpercent" and not percent. Go through your code and fix all instances of similar problems and see if that helps

EDIT - as I was writing this response smohd pointed out the same problem I was talking about, so take a look at what he highlighted because that's exactly what I was referring to

This post has been edited by RobW1985: 22 August 2011 - 10:02 AM

Was This Post Helpful? 0
  • +
  • -

#10 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

Re: I need help with Java programming!

Posted 22 August 2011 - 12:44 PM

View Postsmohd, on 22 August 2011 - 09:54 AM, said:

Look at this part of code:
textFieldDisplay = new JTextField(10);
	        buttonSet.add(textFieldDisplay);
	        JButton buttoncalculate = new JButton(" MC ");
	        buttonSet.add(calculate);
	        JButton buttonpercent = new JButton(" % ");
	        buttonSet.add(percent);
	        JButton buttonequation = new JButton(" E ");
	        buttonSet.add(equation);
	        JButton buttonaddition = new JButton(" + ");
	        buttonSet.add(addition);
	        JButton buttonTotal = new JButton(" Total ");
	        buttonSet.add(total);
	        JButton.buttonsquareroot = new JButton(" ^ ");
	        buttonSet.add(squareroot);
	        JButton.buttondivide = new JButton(" / ");
	        buttonSet.add(divide);
	        JButton.buttonsubtract = new JButton(" - ");
	        buttonSet.add(subtract);
	        JButton.buttonequals = new JButton(" = ");
	        buttonSet.add(equals);
	        JButton.buttonstage = new JButton(" STG ");
	        buttonSet.add(stage);
	        JButton.buttonclear = new JButton(" CE ");
	        buttonSet.add(clear);
	        JButton.buttoninterest = new JButton(" interest ");
	        buttonSet.add(interest);
	        JButton.buttonaverage = new JButton(" average ");
	        buttonSet.add(average);
	        JButton.buttonbalance = new JButton(" balance ");
	        buttonSet.add(balance);
	        JButton.buttonsave = new JButton(" save ");
	        buttonSet.add(save);


You have a lot of undeclared variable, you declare buttoncalculate and then use it as calculate!!!


I'm sorry I'm still learning. Can you please explain what you mean? I declared buttoncalculate and then use it as calculate. In other words, I declared buttoncalculate but then used the word calculate instead of buttoncalculate?

View PostRobW1985, on 22 August 2011 - 09:59 AM, said:

when you add buttons you must specifically add the correct button name, look at your code on these two lines
JButton buttonpercent = new JButton(" % ");
buttonSet.add(percent);



Your adding a button called percent on the second line but on the first line you create a button called buttonPercent. The error cannot find symbol means it can't locate the item your trying to use, in this case "percent", which it won't be able to because you didn't create one. You created a button called buttonpercent, so when you add the button you need to add "buttonpercent" and not percent. Go through your code and fix all instances of similar problems and see if that helps

EDIT - as I was writing this response smohd pointed out the same problem I was talking about, so take a look at what he highlighted because that's exactly what I was referring to


Thank you, I will give it a try!!!
Was This Post Helpful? 0
  • +
  • -

#11 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

Re: I need help with Java programming!

Posted 22 August 2011 - 12:54 PM

Ok everyone, thanks so much for the help. I got it to compile by following your advice and removing any unneeded imports and such. Here is an example of what my finished code looks like:

package mortgagecalc4;
import java.awt.Container.*;
import java.awt.Dimension.*;
import java.awt.FlowLayout.*;
import java.awt.GridLayout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat.*;
import java.text.NumberFormat.*;
import java.util.Locale.*;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Mortgagecalc4{


private static final int FRAME_WIDTH = 150;
private static final int FRAME_HEIGHT = 120;
	 
  // Keeps track of the current operation (subtract, add, etc)
private static final int Decline_Calculation = 0;
private static final int ADDITION = 1;
public static int Calculation = Decline_Calculation;
 
public static JTextField textFieldDisplay;
public static double Set1 = 0; // holds the value before the operation
    
    public static void main(String[] args) {
        // Set up the user interface
	        JFrame frame = new JFrame();
	        JPanel buttonSet = new JPanel();
	        frame.add(buttonSet);
	 
	        // create two buttons, plus and equal and a text box for answers
	        textFieldDisplay = new JTextField(10);
	        buttonSet.add(textFieldDisplay);
	        JButton calculate = new JButton(" MC ");
	        buttonSet.add(calculate);
	        JButton percent = new JButton(" % ");
	        buttonSet.add(percent);
	        JButton equation = new JButton(" E ");
	        buttonSet.add(equation);
	        JButton addition = new JButton(" + ");
	        buttonSet.add(addition);
	        JButton Total = new JButton(" Total ");
	        buttonSet.add(Total);
	        JButton squareroot = new JButton(" ^ ");
	        buttonSet.add(squareroot);
	        JButton divide = new JButton(" / ");
	        buttonSet.add(divide);
	        JButton subtract = new JButton(" - ");
	        buttonSet.add(subtract);
	        JButton equals = new JButton(" = ");
	        buttonSet.add(equals);
	        JButton stage = new JButton(" STG ");
	        buttonSet.add(stage);
	        JButton clear = new JButton(" CE ");
	        buttonSet.add(clear);
	        JButton interest = new JButton(" interest ");
	        buttonSet.add(interest);
	        JButton average = new JButton(" average ");
	        buttonSet.add(average);
	        JButton balance = new JButton(" balance ");
	        buttonSet.add(balance);
	        JButton save = new JButton(" save ");
	        buttonSet.add(save);
	 
	 
	        // frame size the the calculator
	        frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
	        frame.setTitle("Mortgage Calculator");
	        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        frame.setVisible(true);
	 
	 
	        // called when the equal sign '=' is pressed
	        class EqualSignListener implements ActionListener {
	 
            @Override
	            public void actionPerformed(ActionEvent event)
	            {
	                double Set2 = Double.parseDouble(textFieldDisplay.getText());
	                if (Calculation == ADDITION) {
	                    // plus sign pressed before the equal sign
	                    Set2 += Set1;
	                }
	                // Convert from a answer to a string
	                Double answer = new Double(Set2);
	                textFieldDisplay.setText( answer.toString() );
	                // Reset the operation to show no current operation
	                Calculation = Decline_Calculation;
	            }
	        }
	 
	        // called when a plus sign '+' is pressed
	        class PlusSignListener implements ActionListener {
            @Override
	            public void actionPerformed(ActionEvent event)
	            {
	                Set1 = Double.parseDouble(textFieldDisplay.getText());
	                Calculation = ADDITION;
	            }
	        }
	 
	        // Add the methods that will be called when these buttons are pressed
	        ActionListener AdditionSignListener = new AdditionSignListener();
	        addition.addActionListener(AdditionSignListener);
	 
	        ActionListener equalSignListener = new EqualSignListener();
	        buttonequals.addActionListener(equalSignListener);
	 
	        //Declare variable for loan amount
                double LoanAmt = 200000;
	        double Principle1, Principle2, Principle3;
	        double Payments1, Payments2, Payments3;// creates variable for three different payment amounts
	        double Monthlyinterest1, Monthlyinterest2, Monthlyinterest3; //creates variables for three differene interest amounts
	        double Monthlyprinciple1, Monthlyprinciple2, Monthlyprinciple3; //creates variables for three different principal paymentamounts
	        Principle1 = LoanAmt;
	        Principle2 = LoanAmt;
	        Principle3 = LoanAmt;
	        Monthlyprinciple1 = 0;
	        Monthlyprinciple2 = 0;
	        Monthlyprinciple3 = 0;
	        Monthlyinterest1 = 0;
	        Monthlyinterest2 = 0;
	        Monthlyinterest3 = 0;
	        int Count = 1;
	 
	 
	 
	 
	        //create loan term array
	        double [] Term = {84, 180, 360};
	 
	        //create interest rate array
	        double [] Rate = {.0535, .055, .0575};
	 
	        //calculations for each payment amount
	        Payments1 = (LoanAmt * Rate[0]/12) / (1-Math.pow(1+Rate[0]/12,-Term[0]));
	        Payments2 = (LoanAmt * Rate[1]/12) / (1-Math.pow(1+Rate[1]/12,-Term[1]));
	        Payments3 = (LoanAmt * Rate[2]/12) / (1-Math.pow(1+Rate[2]/12,-Term[2]));
	 
	        //output
	        System.out.println("\t\tMonthly Payment Schedule");
	        System.out.println();
	        System.out.println("\t\tLoan Amount: $200,000.00");
	        System.out.println("\t\tTerm: 7 Years");
	        System.out.println("\t\tInterest Rate 5.35%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments1);
	        System.out.println();
	        System.out.println("\t\tTerm: 15 Years");
	        System.out.println("\t\tInterest Rate 5.5%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments2);
	        System.out.println();
	        System.out.println("\t\tTerm: 30 Years");
	        System.out.println("\t\tInterest Rate 5.75%");
	        System.out.printf("\t\tThe monthly payment amount is $%.2f", Payments3);
	        System.out.println();
	 
	 
	 
	 
	 
	 
	        if (Principle1 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest1 =        (Principle1 * Rate[0]) / 365 * 30;
	                Monthlyprinciple1 =  (Payments1 - Monthlyinterest1);
	                Principle1 =       (Principle1 - Monthlyprinciple1);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest1);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple1);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle1);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle2 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest2 =        (Principle2 * Rate[0]) / 365 * 30;
	                Monthlyprinciple2 =  (Payments2 - Monthlyinterest2);
	                Principle2 =       (Principle2 - Monthlyprinciple2);
	 
	                if (Principle1 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest2);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple2);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle2);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	        }
	 
	        else if (Principle3 <= 0)
	        {
	                //monthly calculations for first payment amount
	                Monthlyinterest3 =        (Principle3 * Rate[0]) / 365 * 30;
	                Monthlyprinciple3 =  (Payments3 - Monthlyinterest3);
	                Principle3 =       (Principle3 - Monthlyprinciple3);
	                if (Principle2 <= 0)
	                {
	                        //outputs
	                        System.out.printf("Interest payment: $%.2f", Monthlyinterest3);
	                        System.out.println("");
	                        System.out.printf("Principal payment: $%.2f", Monthlyprinciple3);
	                        System.out.println("");
	                        System.out.printf("New Principal Balance: $%.2f", Principle3);
	                        System.out.println("");
	                        Count++;
	                }
	                else
	                {
	                        System.out.printf("The principal balance is $0.00");
	                        System.out.printf("");
	                }
	 
	        }
	 
	        System.exit(0);
	    }
	}





When I run though this error pops up:
Exception in thread "main" java.lang.UnsupportedOperationException: Not yet implemented
at mortgagecalc4.buttonequals.addActionListener(buttonequals.java:16)
at mortgagecalc4.Mortgagecalc4.main(Mortgagecalc4.java:114)

It is one this coding for the throw new UnsupportedOperationException("Not yet implemented");

package mortgagecalc4;

import java.awt.event.ActionListener;

/**
 *
 * @author Falloncade
 */
class buttonequals {

    static void addActionListener(ActionListener equalSignListener) {
        throw new UnsupportedOperationException("Not yet implemented");

Was This Post Helpful? 0
  • +
  • -

#12 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 22 August 2011 - 12:54 PM

Ya that is it, that is why the compiler claims that it doesnt understand what is calculate or those names which are not declared. It should be like at this line:
  textFieldDisplay = new JTextField(10);
buttonSet.add(textFieldDisplay);
and the same to the other lines.
Was This Post Helpful? 0
  • +
  • -

#13 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 22 August 2011 - 01:10 PM

 throw new UnsupportedOperationException("Not yet implemented");

This line means if this line is called will throw this exception, means this line was put into this code so as to show that this method is not yet implemented. What you have to do is to implement this method with the code you want to use(what you want to happen).
I think it will be better to get started with Oracle Swing Tutorials
Was This Post Helpful? 0
  • +
  • -

#14 falloncade  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 17-July 11

Re: I need help with Java programming!

Posted 22 August 2011 - 01:18 PM

Thank you very much for all your help!!! I only have another 3 weeks left of this class and I'm hoping I will do good as well as learn, which you did help teach me a lot!!
Was This Post Helpful? 0
  • +
  • -

#15 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1817
  • View blog
  • Posts: 4,625
  • Joined: 14-March 10

Re: I need help with Java programming!

Posted 22 August 2011 - 01:34 PM

Hope you will do good :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1