How can I create an object by getting the required parameters from JTextFields?
-
I have 3 JTextFields. Description, deposit and rate. I want the values entered into these fields to be used to create an object from another class which requires these 3 fields (Descrpiton, deposit and rate) and add this field to my current array list. I do not know the correct syntax to make this happen. Appreciate any help. Thanks
-
Answer:
You need to convert the things from JTextField to appropriate type and call appropriate constructor of that class I assume Description is sttring deposit integer rate integer Assuming T1, T2, T3 are JTextFields new yourclass(T1.getText(), Integer.parseInt(T2.getText()), Integer.parseInt(T3.getText()) )
Maho at Yahoo! Answers Visit the source
Related Q & A:
- How can I create my own hosted svn server?Best solution by stackoverflow.com
- How can I retrieve the object properties values from the database?Best solution by Stack Overflow
- How can i create gift card in magento community edition?Best solution by Magento
- How Can I Create an XML to Create a Menu?Best solution by Drupal Answers
- How can I finish my homework without getting distracted?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.