wood burning stoves*
The moose likes Beginning Java and the fly likes Java GUI loan and payment calculator help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java GUI loan and payment calculator help" Watch "Java GUI loan and payment calculator help" New topic
Author

Java GUI loan and payment calculator help

mike saggese
Greenhorn

Joined: Nov 27, 2012
Posts: 8
hey there, I'm new to Java and I need help with this assignment: Write a Java program to calculate and display monthly and total payments given interest starting from 3% to 6% (with an increment of 0.125%). The user inputs are loan amount and loan period (i.e., number of years).

Here's what I have so far



I also have this code as reference to what I want to do but isn't exactly how I want it done



If anyone can help me make heads or tails of anything that would be great thanks
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4168
    
  21

Do you have a problem or question with the code? Are you stuck someplace? TellTheDetails (<-link)


Steve
mike saggese
Greenhorn

Joined: Nov 27, 2012
Posts: 8
Steve Luke wrote:Do you have a problem or question with the code? Are you stuck someplace? TellTheDetails (<-link)


Yes. My gripe is where do I put the interest rate and monthly payment and total payment formula for the show table button to calculate the loan?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4168
    
  21

My suggestion would be in a different class. Have a class whose sole purpose is to maintain a balance, total term, take a percentage rate as a value, and generate the payment amount.

I would create a small gui-less example (like the second code) to test out the class to make sure that the class does what you need it to do.

Then I would use the information learned from the gui-less example (i.e. what methods have to be called in what order) to generate the functionality of your actionPerformed method in your GUI.
mike saggese
Greenhorn

Joined: Nov 27, 2012
Posts: 8
Steve Luke wrote:My suggestion would be in a different class. Have a class whose sole purpose is to maintain a balance, total term, take a percentage rate as a value, and generate the payment amount.

I would create a small gui-less example (like the second code) to test out the class to make sure that the class does what you need it to do.

Then I would use the information learned from the gui-less example (i.e. what methods have to be called in what order) to generate the functionality of your actionPerformed method in your GUI.


I did a little more with the code. How about this?



for some reason however I keep getting an error on line 81 saying illegal start of expression. how do I fix that?
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

mike saggese wrote:for some reason however I keep getting an error on line 81 saying illegal start of expression. how do I fix that?

Look at line 81 carefully, you are declaring the incrementRate() without ending actionPerformed().


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java GUI loan and payment calculator help
 
Similar Threads
cant get program loop to work?
Arrays
Scroll panel problems
Java Course help needed -Mortgage
Event problems