Solved

User Entry

Posted on 2008-06-13
2
266 Views
Last Modified: 2013-12-14
I have written a small Java application with a GUI that calculates mortgages.  One version allows the user to calculate the mortgage payment by entering the loan amount, interest rate and term.  It also allows the user to select interest rate and term choices, by clicking a button for that option and then enter the loan amount.   Here is the problem, if you enter the loan amount and then select the loan option button, it clears the amount you entered.  I have no idea what's causing it or where to look.

I am hoping that you can point me in the right direction without viewing the code.  
0
Comment
Question by:Athanman
2 Comments
 
LVL 13

Accepted Solution

by:
Bart_Cr earned 500 total points
Comment Utility
The Swing API does not clear a text field by itself, so somewhere in your code there should be a JTextField.setText("") to clear it.

Of course, without viewing the code it's hard to pinpoint the exact location, but searching for setText is where I would start.
0
 
LVL 1

Author Comment

by:Athanman
Comment Utility
You got it, my if statements for those button clicks had:
loanamountfield.setText("");
once I took that out, it's good to go.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now