| Author |
adding new button to gui calculator
|
mike saggese
Greenhorn
Joined: Nov 27, 2012
Posts: 8
|
|
Hi, this might be a oddball question but how do I add total payment to this gui calculator? I know the code works for sure, and somewhere in the code there's
//Labels to identify the fields
private JLabel amountLabel;
private JLabel rateLabel;
private JLabel numPeriodsLabel;
private JLabel paymentLabel;
//Strings for the labels
private static String amountString = "Loan Amount: ";
private static String rateString = "Interest Rate (%): ";
private static String numPeriodsString = "Years: ";
private static String paymentString = "Monthly Payment: ";
//Fields for data entry
private JFormattedTextField amountField;
private JFormattedTextField rateField;
private JFormattedTextField numPeriodsField;
private JFormattedTextField paymentField;
//Formats to format and parse numbers
private NumberFormat amountFormat;
private NumberFormat percentFormat;
private NumberFormat paymentFormat;
can I just simply add total payment to the JFormatted TextField and paymentString or is there something else I need to do?
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10040
|
|
mike saggese wrote:Hi, this might be a oddball question but how do I add total payment to this gui calculator? I know the code works for sure, and somewhere in the code there's
can I just simply add total payment to the JFormatted TextField and paymentString or is there something else I need to do?
What happened when you tried it?
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
mike saggese
Greenhorn
Joined: Nov 27, 2012
Posts: 8
|
|
fred rosenberger wrote:
mike saggese wrote:Hi, this might be a oddball question but how do I add total payment to this gui calculator? I know the code works for sure, and somewhere in the code there's
can I just simply add total payment to the JFormatted TextField and paymentString or is there something else I need to do?
What happened when you tried it?
I know that without the button all I have to do is hit enter and it automatically calculates the payment. but what if I add the button to the code, where should I add it so it won't mess up the entire thing.
Another question I have is how do I make this java file also a web page html file?
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10040
|
|
again, I'll ask "What have you tried?"
Folks here don't hand out solutions to problems. We try to teach and guide. We expect you to ShowSomeEffort (that's a link to a page you should probably read). In fact, you may want to read much of this to get the most out of our site.
|
 |
 |
|
|
subject: adding new button to gui calculator
|
|
|