Converting data inside JTextField to interger

Posted on 2006-05-25
Last Modified: 2010-03-31
hi all

I want to convert what is inside a JTextField to integer. I use the following way :

int blck = Integer.parseInt(readTextField.toString());

but it does not work and it fies the exception handling when use it.

can some one tell me how can I do it and what classes I need to import ??
Question by:ehmf
    LVL 86

    Accepted Solution

    Should be

    nt blck = Integer.parseInt(readTextField.getText());
    LVL 86

    Expert Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    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 …
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    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

    21 Experts available now in Live!

    Get 1:1 Help Now