?
Solved

Syntax to display text in textfield for Java

Posted on 2011-05-06
3
Medium Priority
?
398 Views
Last Modified: 2012-05-11
Hi,
I have created a next button in my java gui calculator program (as I'm sure many have already seen LOL) but I cannot place the syntax correct to show the contents for each text field.

as an example I have:
fnameTextField.getText();
        mortgage.add(fname);

so I'm saving the user input to fname, but I cannot get the correct syntax to display it back into the fnameTextField.

Thank you!!
0
Comment
Question by:marchbaby
  • 2
3 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 35709973
fnameTextField.setText("marchbaby");
0
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 35709981
or without any jokes if

String fname = "Peter Jones";

fnameTextField.setText(fname);

should plate "Peter Jones" in your textField

You want to claer the text filed
you say
fnameTextField.setText("");
0
 

Author Closing Comment

by:marchbaby
ID: 35710003
Thank you!! I like the humor ;-)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

839 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