Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I display integer into textField

Posted on 2009-05-19
3
Medium Priority
?
1,222 Views
Last Modified: 2013-12-14
I am using netbeans. I want something to be displayed in textField. I can do that if the result is a string, but if the result is integer, it gives me error.

jTextField.setText("result");

whats the code to display in int?

Thanks
0
Comment
Question by:chandanchoubey
3 Comments
 
LVL 13

Accepted Solution

by:
Bart Cremers earned 260 total points
ID: 24420851
Wrap it using String.valueOf(...);

To get your int back you'll need Integer.parseInt(jTextField(getText());
0
 
LVL 92

Assisted Solution

by:objects
objects earned 240 total points
ID: 24420886
0
 

Author Closing Comment

by:chandanchoubey
ID: 31582945
Thank you very much, it worked excellent!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

971 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