Results 1 to 2 of 2
  1. #1
    nat
    nat is offline Member
    Join Date
    Dec 2013
    Posts
    56
    Rep Power
    0

    Default Problem with conversion from String to Integer

    Hi,

    I want to conver String value into Integer, and I have this :

    String timeInterval = tfInputTinter.getText();
    Integer tint=(Integer.parseInt(timeInterval))*1000;

    but when I put this second line, the conversion, the program stops to work. I tried also with Integer.valueOf(timeInterval) but again I had the same problem.

    Can anybody help me please what's wrong with the conversion?

    Thanks

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,772
    Rep Power
    5

    Default Re: Problem with conversion from String to Integer

    I suggest you try this:


    Java Code:
    String timeInterval = tfInputTinter.getText();
     System.out.println("timeInterval = '" + timeInterval + "'");
    Integer tint=(Integer.parseInt(timeInterval))*1000;
    System.out.println("tint = " + tint);
    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. String to Integer Conversion in JSP
    By rajashripawar11@gmail.com in forum New To Java
    Replies: 15
    Last Post: 11-19-2012, 10:48 AM
  2. Replies: 6
    Last Post: 09-14-2012, 12:33 PM
  3. string to integer conversion
    By boys21 in forum New To Java
    Replies: 3
    Last Post: 10-17-2011, 03:58 PM
  4. String to Integer Conversion in JSP
    By vinikz in forum New To Java
    Replies: 8
    Last Post: 11-10-2010, 02:45 PM
  5. String to Integer conversion
    By eva in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 03:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •