How do I display integer into textField

Posted on 2009-05-19
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.


whats the code to display in int?

Question by:chandanchoubey
LVL 13

Accepted Solution

Bart_Cr earned 65 total points
Comment Utility
Wrap it using String.valueOf(...);

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

Assisted Solution

objects earned 60 total points
Comment Utility

Author Closing Comment

Comment Utility
Thank you very much, it worked excellent!!

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

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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.

728 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